tags:

views:

44

answers:

2

hi all

I have question is it possible to perform a phrase search with wild cards in solr/lucene as if i have two queries both have exactly same results one is

+Contents:"change market"

and other is

+Contents:"chnage* market"

but i think the second should match "chages market" as well but it does not matches it. Any help would be appreciated

Regards Ahsan

A: 

IMO it is not possible to search for wild cards with in phrase. You might want to consider using two queries with proximity search.(q=change* market&qs=1) http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_search_for_one_term_near_another_term_.28say.2C_.22batman.22_and_.22movie.22.29

kaka
@kaka: I had tried wht you r saying but unfortunately it doesn't work as i guess it will get documents having change* or market in the contents.
Ahsan Iqbal
@Ahsan: it depends on default operator in schema, you can set it to 'AND' to get the desired result.
kaka
+1  A: 

You can do this in Lucene with ComplexPhraseQueryParser. Solr has facility to plug in custom query parser with QParserPlugin. You can possibly use these two to have desired functionality with Solr as well.

Shashikant Kore