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
Post a Comment