How to filter by keyword and URL?

17 views
Skip to first unread message

Filipe

unread,
Aug 9, 2011, 3:52:32 PM8/9/11
to SolrNet
Hi everyone one!

Im using Solr and is working very well, but i need to increment my
advanced search and one of my needs is to filter the results by
keyword and url.

Let me explain:

I query solr with a keyword and i need to display only the results
that has the keyword and the url of the result is in google.com for
example.

How can i do that? I tried a lot of things and cant get what im
looking for.

Thank you all!
Filipe

Mauricio Scheffer

unread,
Aug 9, 2011, 4:05:18 PM8/9/11
to sol...@googlegroups.com
It depends... you could use dismax for keyword searches and filter queries to filter by other fields such as URL.
If you're not sure about how to do that with Solr, I recommend asking on the solr-user mailing list.

--
Mauricio



--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To post to this group, send email to sol...@googlegroups.com.
To unsubscribe from this group, send email to solrnet+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/solrnet?hl=en.


Filipe

unread,
Aug 9, 2011, 4:13:36 PM8/9/11
to SolrNet
I tried this:

solr.Query(new SolrQuery(keyword) && new SolrQueryByField(url), ...

but is not working, my schema has the field "url" with the url of the
result.



On Aug 9, 5:05 pm, Mauricio Scheffer <mauricioschef...@gmail.com>
wrote:

Filipe

unread,
Aug 9, 2011, 4:16:58 PM8/9/11
to SolrNet
sorry, i tried this:

solr.Query(new SolrQuery(keyword) && new SolrQueryByField("url",
"google"), ...

Mauricio Scheffer

unread,
Aug 9, 2011, 4:21:34 PM8/9/11
to sol...@googlegroups.com
Most likely it's an issue with the analysis config in the url field.
Do you get correct results when trying this query on the Solr web admin console?

--
Mauricio

Filipe

unread,
Aug 9, 2011, 4:37:13 PM8/9/11
to SolrNet
if i try this query: url:MyUrl AND Keyword in the admin console it
works fine.

but if i try this on the query string like this:
/solr/nutch?q=url:MyUrl i got nothing in the results.

On Aug 9, 5:21 pm, Mauricio Scheffer <mauricioschef...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages