Dilip Ganesh
Dilip Ganesh

Reputation: 101

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).

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

Any ideas

Thanks

Dilip.

Upvotes: 1

Views: 74

Answers (1)

Jesvin Jose
Jesvin Jose

Reputation: 23098

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

Upvotes: 1

Related Questions