开发者

Search only particular index

I am using Apache Solr for my search , using this i am indexing variety of resources such as (PDF,MS Word document).

开发者_JAVA技巧

If let say the user giving the query like "PDF: java" then i wants to search only the PDF files

Any ideas

Thanks

Dilip.


Well, like I commented. Set up a filetype[string] in your schema and set it when you upload that file.

http://localhost:8983/solr/update/extract?literal.id=123&literal.filetype=pdf

and when you search

http://localhost:8983/solr/select?q=text:electrical design AND filetype:pdf


Quick hack: if your documents are identified by filename, you can tell Solr to limit results to those ending in *.pdf by

http://localhost:8983/solr/select?q=text:electrical design AND id:*.pdf

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜