However, if I search for "100" wanting to find, for example, a document with the "description" as "pipe 100mm", it doesn't bring me this document as a result, it only matches "100" as a prefix for other number (i.e. 10056) or as a full word.
I am using the Javascript client. Description is a field mapped as text.
What are the limitations of phrase_prefix on this case, and what could I change in the query so I can get the results as wanted?
I haven't tried to use ngrams or search_as_you_type yet as I wanted to understand why the above does not work. If there isn't a workaround, let me know.
I tried match_phrase_prefix, but with no luck, maybe there's a detail that changes it's behaviour, since I've got a pretty big index and mapping. I was wondering why phrase_prefix is working fine for queries like "smart" returning documents such as "smartphone" or "1520" returning documents such as "15203289", but "50" isn't recognized as a prefix for "50cm".
I informed the settings to simulate searches. In all tests I got a result (tests with smart, 100, 1502 and 50).
Below are the test codes. You say that the match_phrase_prefix did not work, maybe there is some information missing from your question.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.