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

Java API does not have a way to set global highlighting settings #5281

Closed
seallison opened this issue Feb 27, 2014 · 2 comments
Closed

Java API does not have a way to set global highlighting settings #5281

seallison opened this issue Feb 27, 2014 · 2 comments

Comments

@seallison
Copy link

There is no method in the Java API on SearchRequestBuilder to set the global highlighting options for 'fragment_size' or 'number_of_fragments'.

The documentation lists this ability in the 0.90.X series as well as 1.0.X series:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/search-request-highlighting.html#highlighting-settings

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html#highlighting-settings

I am working around this by using the method:

addHighlightedField(name, fragmentSize, numberOfFragments)

But that is not ideal since my fragmentSize and numberOfFragments doesn't change on a per field basis.

Please see: https://groups.google.com/forum/#!topic/elasticsearch/a4K8yfMqim4

@javanna
Copy link
Member

javanna commented Feb 28, 2014

Agreed the highlighting API could be clearer :)

You could work around this by using the SearchSourceBuilder which allows you to set the HighlightBuilder, which is the object that allows you to control everything about highlighting.

@javanna javanna self-assigned this Mar 28, 2014
@javanna
Copy link
Member

javanna commented Mar 28, 2014

Actually what I suggested was wrong as the HighlightBuilder doesn't expose those global options either. Fixing!

javanna added a commit that referenced this issue Mar 28, 2014
Exposed HighlightBuilder missing global options in Java API: fragmentSize, numOfFragments, highlightFilter, boundaryMaxScan and boundaryChars
Exposed SearchRequestBuilder missing global options shortcuts: setHighlighterFragmentSize, setHighlighterNumOfFragments, setHighlighterFilter, setHighlighterBoundaryMaxScan, setHighlighterBoundaryChars, setHighlighterFragmenter, setHighlighterPhraseLimit & setHighlighterForceSource

Closes #5281
@clintongormley clintongormley added the :Core/Infra/Transport API Transport client API label Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants