Elasticquent
Elasticquent copied to clipboard
add highligh search result support
Just add highlight params support.
Hi elasticquent developers & itbdw,
This solution is a great start for highlighting support, but it still requires developers to manually access the getHits()
results collection method to get highlighted terms.
Do we want to consider automatically replacing the highlighted results in their appropriate fields? I can submit a pull request as well if so. Implementation would be similar to the below code after transforming the $highlight
associative array into the right structure.
$return = array_replace($_source, $highlight)
Thanks @itbdw
I want to spend some time this weekend finishing the test suite and looking over open issues & PR's, so this will be looked at properly a little later.
Hi @gluxon Thanks. I've updated the code. We can replace the data fields automatically now if this pull request was merged!
@timgws
@itbdw Awesome! Thanks a lot for this pull request. Can't wait to integrate it into my projects.
@itbdw Thanks for your job.
Is this ever going to get merged back?
@lionslair soon. I am worried that there is roughly 8 paramteres on this searchByQuery function, it is a function that is already doing a lot of work, and it is only going to increase as we add more ES functionality. We need to work out a way that we can pull out some of the parameters away from this function.
I would actually prefer it not to be tied to the search at all. I am performing a search by building a dsl query. I am then passing it through the complexSearch.
I have all the highlights in my results from within the hits. However this will only work for one query. I think it should be split out and actually use the highlights when within hydrateElasticquentResult or newElasticquentResultCollection
Its the fact that hydrateElasticquentResult and newElasticquentResultCollection do not use the hightlights that causes me a big problem.
I realise it is difficult because multiple highlights can exist for one field. however I think if using highlights the highlights could be concatenated together.
In terms of what I am looking for the only solution I see is rebuilding the results all over again into a new collection.
Thoughts?
FYI Only been using laravel for two weeks and elastic for one. sorry if miss something.
near 1 year problem how may faster?
Any update regard highlight?
Highlight functionality is still in review stage when it will be approved ?