System.out.println("Num of results: " + sh.getTotalHits());
I get zero results every time and the data definitely fits the query.
I assume that the above search would return a record with a "Path"
value of "/Marcus/Example". This record exists and so do many others
like it.
I haven't tuned ElasticSearch at all and I don't know if this requires
explicit indexing, but it doesn't work via ElasticSearch Head either
so I think it must be on the server side.
IMO I think that with default mapping, your field "path" is tokenized. You should use a keyword analyzer for this field if you don't want it to be tokenized.
A prefix search on "marcus" with default mapping should give you results.
System.out.println("Num of results: " + sh.getTotalHits());
I get zero results every time and the data definitely fits the query.
I assume that the above search would return a record with a "Path"
value of "/Marcus/Example". This record exists and so do many others
like it.
I haven't tuned Elasticsearch at all and I don't know if this requires
explicit indexing, but it doesn't work via Elasticsearch Head either
so I think it must be on the server side.
Thanks for the advice David. I've only just started using
Elasticsearch, could you explain how to do this?
From your explanation I understand that the field is being indexed only as the keywords, which in this case means that I can't use
prefix to find records that begin with the exact string.
Assuming no configuration, what do I need to set in order for the
following to occur?
Index records with "Path" values:
"/Marcus/Example/One"
"/Marcus/Example/"
"/Marcus/"
And these be returned when I use a prefix search with the value "/
Marcus/".
IMO I think that with default mapping, your field "path" is tokenized. You should use a keyword analyzer for this field if you don't want it to be tokenized.
A prefix search on "marcus" with default mapping should give you results.
System.out.println("Num of results: " + sh.getTotalHits());
I get zero results every time and the data definitely fits the query.
I assume that the above search would return a record with a "Path"
value of "/Marcus/Example". This record exists and so do many others
like it.
I haven't tuned Elasticsearch at all and I don't know if this requires
explicit indexing, but it doesn't work via Elasticsearch Head either
so I think it must be on the server side.
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.