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

Automatic prefix on text fields should index offsets and term vectors if they are activated on the parent field #28994

Closed
jimczi opened this issue Mar 12, 2018 · 1 comment · Fixed by #29067
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories

Comments

@jimczi
Copy link
Contributor

jimczi commented Mar 12, 2018

The new option index_prefix on text fields that automatically creates a sub-field to index edge-ngrams in order to speed up prefix queries does not check the index options of the parent field.
If offsets or term_vectors for instance are indexed in the parent text field, they will be omitted in the prefix sub-field. Currently this sub-field only indexes doc and disables all other options, this was done to make sure that this sub-field does not use extra disk space for features that won't be used by the query. Though it could be beneficial to apply the same options than the parent field if we want to use this sub-field for highlighting prefix queries. Currently highlighting prefix queries on a text field does not work in conjunction with this new option (we create a term query that targets a different field) but we want to handle this case in the future so it would be beneficial to create this sub-field with the index options set on the parent field if these options are used by the highlighters. This could speed up the prefix query highlighting since a prefix query on that field is a simple term query and since this feature has not been released yet we could also avoid BWC issue by adding these options in the first release of this feature (6.3).

@jimczi jimczi added >enhancement :Search/Search Search-related issues that do not fall into other categories labels Mar 12, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

romseygeek added a commit that referenced this issue Mar 16, 2018
…29067)

The index prefix field is normally indexed as docs-only, given that it cannot
be used in phrases.  However, in the case that the parent field has been indexed
with offsets, or has term-vector offsets, we should also store this in the index
prefix field for highlighting.

Note that this commit does not implement highlighting on prefix fields, but
rather ensures that future work can implement this without a backwards-break
in index data.

Closes #28994
romseygeek added a commit that referenced this issue Mar 16, 2018
…29067)

The index prefix field is normally indexed as docs-only, given that it cannot
be used in phrases.  However, in the case that the parent field has been indexed
with offsets, or has term-vector offsets, we should also store this in the index
prefix field for highlighting.

Note that this commit does not implement highlighting on prefix fields, but
rather ensures that future work can implement this without a backwards-break
in index data.

Closes #28994
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants