我正在使用排除和標記進行分面。奇怪的是,這是有用的,我沒有空間的價值。Solr方面標記排除不適用於空間
http://192.168.2.114:8983/solr/customer/select?indent=on&q=*:*&fq=(%7B!tag%3DstateName%7DstateName:%22Gujarat%22)&fq=(%7B!tag%3DstateName%7DstateName:%22AndhraPradesh%22)&facet=true&facet.limit=100&facet.mincount=0&facet.field=%7B!ex%3DstateName%7DcountryName&facet.field=%7B!ex%3DstateName%7DstateName&facet.field=%7B!ex%3DstateName%7Dicity&facet=true
- 這工作
但
http://192.168.2.114:8983/solr/customer/select?indent=on&q=*:*&fq=(%7B!tag%3DstateName%7DstateName:%22Gujarat%22)&fq=(%7B!tag%3DstateName%7DstateName:%22Andhra Pradesh%22)&facet=true&facet.limit=100&facet.mincount=0&facet.field=%7B!ex%3DstateName%7DcountryName&facet.field=%7B!ex%3DstateName%7DstateName&facet.field=%7B!ex%3DstateName%7Dicity&facet=true
- 這不
這兩者之間的唯一區別是空間在{!tag=stateName}stateName="Andhra Pradesh"
({!tag=stateName}stateName="AndhraPradesh"
- 這工作)。
我不明白爲什麼。我試過編碼的URL,即把+
或%20
的空間,仍然沒有運氣。
編輯
這裏是stateName
字段的定義。
<field name="stateName" type="string" multiValued="false" indexed="true" stored="true"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
您能否在第二張圖片中發佈完整的請求產生錯誤?它說「無法解析...」似乎在查詢中有一個非轉義的特殊字符。 btw%27不適用於空間,%20是。 – Zac
這是完整的形象,我只是去了這麼多的迴應。 – Akshay
是的,我用%20試過,輸入問題時出現錯字。我編輯了這個問題 – Akshay