Elasticsearch/Lucene: Query to Find a Word Near the Start or End of a Document -


is there way build elastic search query matches documents if given term appears within x spaces of start of document?

i understand can use span_near , slop find instances of term within x spaces of term, don't know how find instances term near start or end of document.

the motivation here because have set of documents start particular set of words, , want able query based on first word. understand can re-index documents, pull out first word field, , query separately, prefer not have re-index this.

have tried span_first? looks need.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -