我正在使用Apache Solr進行搜索。我使用數據導入處理程序從mysql表導入數據。但是當我使用q=KOHLI
insigned q=lastname:KOHLI
時,我沒有得到任何結果。Apache Solr搜索
這裏是q=lastname:KOHLI
{
"responseHeader": {
"status": 0,
"QTime": 1,
"params": {
"q": "lastname:KOHLI",
"indent": "true",
"wt": "json",
"_": "1427802213299"
}
},
"response": {
"numFound": 1,
"start": 0,
"docs": [
{
"lastname": "KOHLI",
"town": "DELHI",
"id": "2",
"firstname": "VIRAT",
"_version_": 1497158663291273200
}
]
}
}
schema.xml中響應:
<copyField source="firstname" dest="text"/>
<copyField source="lastname" dest="text"/>
<copyField source="town" dest="text"/>
<field name="firstname" type="text_general" indexed="true" stored="true"/>
<field name="lastname" type="text_general" indexed="true" stored="true"/>
<field name="town" type="text_general" indexed="true" stored="true"/>`
* text *是您的* defaultSearchField *? – alexf 2015-03-31 13:49:02
@alexf是的,我想通過名字,姓氏或城鎮進行搜索。 – Nagendra 2015-03-31 13:52:22
在你的* solrConfig.xml *中,你沒有使用查詢解析器? – alexf 2015-03-31 13:53:23