All,
I am indexing data with the following mapping:
{
"typeName" : {
"properties" : {
"fullName" : {
"type" : "multi_field",
"fields":{
"fullName" : {"type" : "string",
"index" : "analyzed"},
"untouched" : {"type" : "string",
"index" : "not_analyzed"}
}
}
}
}
}
And indexing it by doing the following (in groovy):
public void simpleIndex(indexId, items){
if(items.size() > 0){
BulkRequestBuilder bulkRequestBuilder =
elasticSearchClient.prepareBulk()
items.each { item ->
IndexRequestBuilder indexRequestBuilder =
elasticSearchClient.prepareIndex(indexId, "typeName")
indexRequestBuilder.setId(item.id.toString())
indexRequestBuilder.setSource("fullName",
item.getFullName())
bulkRequestBuilder.add(indexRequestBuilder)
}
BulkResponse response =
bulkRequestBuilder.execute().actionGet()
if (response.hasFailures()) {
log.error("Error indexing: $
{response.buildFailureMessage()}")
}
}
}
This isn't the only type that's in the index. Although, there are
significantly less numbers of this type in the index than the other.
To keep this issue simple, the following code snippet will not pass:
GetResponse getResponse = client.prepareGet(indexName, "typeName",
"1").execute().actionGet()
assert getResponse.exists()
assert getResponse.id == "1"
assert getResponse.fields.size() > 0
It won't pass because fields is empty. However, the id is there and is
correct. The same issue will happen when performing a search as well.
I will get hits back, but no fields. So far, the only thing that fixes
this is restarting the node. When the node comes back up, the fields
will be there. I have tried a refresh, flush, and cache clear, all
with no affect. The issue is the same when using both node and
transport. I have also tried ditching the mapping for fear that the
multi-field type was causing issues (even though it works elsewhere
just fine) with no luck. Am I missing something?
Thanks in advance.