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:
And these be returned when I use a prefix search with the value "/
On Aug 21, 1:47 am, David Pilato da...@pilato.fr wrote:
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.
Hope this helps.
Le 21 août 2011 à 01:23, marcuslongmuir marcuslongm...@me.com a écrit :
I can't seem to get prefix searching to work at all. I'm using the
Java API with the following:
QueryBuilder qb = QueryBuilders.boolQuery()
SearchResponse response = client.prepareSearch("objects")
SearchHits sh = response.getHits();
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
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 any help.