First, sorry for my poor english, but let me try to explain my problem.
I'm working in an application using elasticsearch java api for managed my documents.
Everything works fine, i'm able to search in DB and save on my index, i can count my documents aggregate by field and a lot of cool things, but i stucked on a weird problem.
When i trying to search my document by field called name, some documents doesn't return on search.
Let me give an example:
My documents is look like this(just for example):
id: 1
name: book
type: pdf
id: 2
name: Test of my search service
type: zip
When i trying to search, if i search by name, send as parameter the value "book", it works fine, but when i trying to search, send my parameter value "service", the result is empty.
About your question, I add this config on my index because if I don't add this, elasticsearch splitting my string values on index step and also splitting my string values in search response.
For example, if I work without this config, I got the response from my service like this:
{
Id: 2,
name: my
id: 2,
name: service
id: 2,
name: documents
}
(Just an example)
When I search for how to "fix it" a guy who had the same problem send me this "trick".
I'd not mark this as a solution. This is a very bad solution and it will produce very bad response time with the number of terms in fieldName in the inverted index.
You have to understand how a search engine works and what you need to do to make it work as you wish.
The fact that your document 2 as been indexed like:
{
"name": [ "my", "service", "documents" ]
}
is exactly made to serve the search purpose you are asking for.
What is wrong with that? I mean why do you care about this?
I feel like you are also trying to run aggregations and you don't like the fact the result is split.
If this is the use case you have, just tell and we will help you to fix that the right way.
First: make you search works with standard search.
Then fix the other things. I'll be happy to help.
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.