How to use wildcards #35

mads379 opened this Issue May 12, 2012 · 7 comments

2 participants


Hi there,

How do I use wildcards? If I do something like the following:

val r = SolrBook where (_.title eqs "*game thr*")

then the wildcards gets escaped

res13: Seq[(String, String)] = List((start,0), (rows,10), (q,title:("\*game thr\*")))

Hi mads379,

By default all of our queries are escaped, we have a representation in our AST for it but not in the query language its self right now. I'll add that.




Oh also, just a heads up that query is likely going to have terrible performance on Solr (front wildcards are slow). You might want to consider doing edgengram or ngram generation on a field if your going to be doing a lot of those types of queries.


Oh, interesting. Would you be able to point me in the right direction (reading wise) on how to efficiently use solr to search the following: Given a partial book title (entered by the user), list all books with that title. That is, if I search for "game of" it should show "A Game of Thrones".


Well if you have tokenized your string (even with text_ws) "game of" will match "a game of thrones". You only really need the * if you were interested in "game of" matching "ninjagame ofthrones"


A phrase query should do just that, eqs gives you phrase style matching and contains gives you bag of words style matching.


eqs query combined with EdgeNGramFilterFactory & LowerCaseFilterFactory gives me good results so far. This wildcard query issue isn't a priority for me anymore so you don't need to hurry for my sake.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment