Elasticquent icon indicating copy to clipboard operation
Elasticquent copied to clipboard

add highligh search result support

Open itbdw opened this issue 8 years ago • 11 comments

Just add highlight params support.

itbdw avatar Aug 02 '16 09:08 itbdw

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)

gluxon avatar Aug 05 '16 04:08 gluxon

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.

timgws avatar Aug 05 '16 06:08 timgws

Hi @gluxon Thanks. I've updated the code. We can replace the data fields automatically now if this pull request was merged!

@timgws

itbdw avatar Aug 06 '16 03:08 itbdw

@itbdw Awesome! Thanks a lot for this pull request. Can't wait to integrate it into my projects.

gluxon avatar Aug 06 '16 20:08 gluxon

@itbdw Thanks for your job.

AlexLove77 avatar Aug 10 '16 10:08 AlexLove77

Is this ever going to get merged back?

lionslair avatar Dec 13 '16 06:12 lionslair

@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.

timgws avatar Dec 13 '16 06:12 timgws

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.

lionslair avatar Dec 13 '16 09:12 lionslair

near 1 year problem how may faster?

avesgit avatar Dec 10 '17 19:12 avesgit

Any update regard highlight?

rajurajpurohit avatar Dec 15 '19 17:12 rajurajpurohit

Highlight functionality is still in review stage when it will be approved ?

Moaiz-Pervaiz avatar Feb 03 '22 11:02 Moaiz-Pervaiz