Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add highligh search result support #104

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

itbdw
Copy link

@itbdw itbdw commented Aug 2, 2016

Just add highlight params support.

@gluxon
Copy link

gluxon commented Aug 5, 2016

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)

@timgws
Copy link
Member

timgws commented Aug 5, 2016

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.

@itbdw
Copy link
Author

itbdw commented Aug 6, 2016

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

@timgws

@itbdw itbdw mentioned this pull request Aug 6, 2016
@gluxon
Copy link

gluxon commented Aug 6, 2016

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

@AlexLove77
Copy link

@itbdw Thanks for your job.

@lionslair
Copy link

Is this ever going to get merged back?

@timgws
Copy link
Member

timgws commented Dec 13, 2016

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

@lionslair
Copy link

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.

assume you set "number_of_fragments"=>1 on highlight setting

ie.
```
            $highlight=[
                "fragment_size"=>150,
                "no_match_size"=>150,
                "number_of_fragments"=>1,
                "fields"=>[
                    "title"=>(Object)[],
                    "content"=>(Object)[],
                ],
            ];
```
@avesgit
Copy link

avesgit commented Dec 10, 2017

near 1 year problem how may faster?

@rajurajpurohit
Copy link

Any update regard highlight?

@Moaiz-Pervaiz
Copy link

Moaiz-Pervaiz commented Feb 3, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants