2013-07-04 46 views
0

看來,對CouchDB的,Lucene的默認一起爲OR對CouchDB的,Lucene的默認結合

artist:muse track:"feeling good" 

可能返回:

{ "artist": "Muse", "track": "Feeling Good", "score": 5.9 } 
{ "artist": "Nina Simone", "track": "Feeling Good", "score": "1.2" } 

如何配置CouchDB的,Lucene的,這樣兩種說法就像在這裏頂部被認爲是AND'd在一起,而不是OR'd?

回答

1

從我的自述文件https://github.com/rnewson/couchdb-lucene/,你可以使用一個參數來改變這個;

default_operator 
Change the default operator for boolean queries. Defaults to "OR", 
other permitted value is "AND". 

即,

?q="hello there"&default_operator="AND" 
+0

我知道我在某處讀過它 - 不知道爲什麼我再也找不到它了!非常感謝! –