Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

How to use wildcards #35

Open
mads379 opened this Issue · 7 comments

2 participants

Mads Hartmann Jensen Holden Karau
Mads Hartmann Jensen

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

r.meta.queryParams(r)
res13: Seq[(String, String)] = List((start,0), (rows,10), (q,title:("\*game thr\*")))
Holden Karau

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.

Cheers,

Holden

Holden Karau

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.

Mads Hartmann Jensen

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

Holden Karau

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"

Mads Hartmann Jensen
Holden Karau

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

Mads Hartmann Jensen

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.

Thanks,
Mads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.