我是Solr的新手。使用以下Solrnet查詢來運行我的搜索。使用SolrNet進行空間搜索和多列
results = solr.Query(new LocalParams { { "type", "dismax" }, { "qf", "Title Description" } } + new SolrQuery(Keywords) , queryOptions);
上述查詢沒有任何問題。我在同一個查詢中使用以下內容嘗試空間搜索。
results = solr.Query(new LocalParams { { "type", "dismax" },{ "pt", "40.7143528,-74.0059731" },{ "sfield", "coords" },{ "d", "15" }, { "qf", "Title Description" } } + new SolrQuery(Keywords) , queryOptions);
上面的查詢並不考慮空間搜索到賬戶,而是返回所有文檔的結果。
如果將「類型」更改爲「geofilt」,相同的查詢將執行空間搜索。
results = solr.Query(new LocalParams { { "type", "geofilt" },{ "pt", "40.7143528,-74.0059731" },{ "sfield", "coords" },{ "d", "15" }, { "qf", "Title Description" } } + new SolrQuery(Keywords) , queryOptions);
但是這一次,它不返回相關結果。即如果用戶搜索「豐田」,上面的查詢type = geofilt可能會返回15公里內的「福特」。
你能指導我走向正確的方向嗎?
請正確格式的代碼片斷。 –