我有以下文件
{
"authors" : "Nanna Friis",
"authorsId" : [ "4642" ],
"description" : "Med denne praktiske og pædagogiske håndbog kommer du hele vejen rundt om at skrive godt til nettet. Du bliver taget ved hånden og får en grundig gennemgang af de helt særlige præmisser, der hersker på nettet. ",
"iSBN" : "9788762904118",
"mediaType" : "10",
"name" : "Kort, klart og klikbart",
"nameSort" : "Kort, klart og klikbart",
"price" : 250.0,
"productId" : "9788762904118",
"publicationAreaCode" : "3077",
"tags" : [ ],
"titleId" : "25004"
}
像
http://localhost:9200/titles/_search?q=Nanna*
这样的查询时,我没有任何结果。如果我改为查询即。像http://localhost:9200/titles/_search?q=9788762904118
这样的productId会使文档出现问题。到底是怎么回事?
最佳答案
您没有在请求中指定查询字段
在这种情况下,您将搜索Default Search Field
When not explicitly specifying the field to search on in the query string syntax, the index.query.default_field will be used to derive which field to search on. It defaults to _all field.
So, if _all field is disabled, it might make sense to change it to set a different default field.
关于lucene - 查询时字段被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15392239/