Вопрос

I am using LucidWorks and I need to restrict my search on a solr database to a particular datasource.

How do you construct a solr query to query a particular datasource?

Thanks,

Dave

Это было полезно?

Решение

Try to index the datasource itself, then you can add a filter subquery fq to the main query so you can restrict your search as you want.

Say for example that documents datasource are indexed in a field called 'src' and you want to query only documents from 'val_1' and documents from 'val_2' datasources, then appending a filter subquery should do the trick e.g. :

.../solr/yourCollection/yourSearchHandler?q=*:*&fq=(src:val_1+OR+src:val_2)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top