例如,我正在搜索用户"John Doe“,但希望只键入"John”或"Doe“来获取该用户。
这是我现在提出的要求:
request('http://' + globals.serverAddress + ':' + globals.lucenePort + '/_fti/local/testdatabase/_design/lucene/by_user_name?q=' + req.query.searchString + '&include_docs=true', function(error, requestResponse, body) {
// Sending the data here from the API to the app
});目前,我可以搜索"John Doe“并获得用户,但不能使用单词的某些部分来查找用户。
提前谢谢。
发布于 2016-02-24 22:40:28
您需要创建一个视图,并将文本中的每一个字自己发送到一个引用,如文档的de id。
这将创建一个巨大的视图,您可以对其进行查询
我猜你在设计/_ design /lucene/by_user_name上发出了一个名为user_name的字段,而不是尝试使用for和split。通过for循环发出,被空格(“")分割的数组中的每个元素都将生成,仅此而已
https://stackoverflow.com/questions/35409240
复制相似问题