> I might be able to try this out though in general the
> project has a
> policy about only using released code (no trunk/unstable).
> https://issues.apache.org/jira/browse/SOLR-1604
> It looks like the kind of searching I want to do is not
> really
> supported in SOLR by default though. Is that correct?

* or ? operators inside phrases are not supported in Solr by default. In Lucene 
contrib package there is a ComplexPhraseQueryParser that allows them.

> I thought that was what my exact definition was doing
> except I also
> want the exact field to be lowercased and trimmed (which I
> don't want
> for all strings). Can you explain what is wrong with the
> current
> definition so I can fix it?

in your attachment the definition is:

<fieldType name="exact" class="solr.TextField" compressed="false" 
indexed="true" stored="true" /> 

I have never seen a field type definition without 
charfilter/tokenizer/tokenfiler chain. Usually string type is used for exact 
match.


> What I really want is the equivalent of a match like this
> along with
> the normal tokenized matching (where the query has been
> lowercased and
> trimmed as well):
> select * from blah where lowercase(column) like '%query%';
> I think this is called a phrase match or something like
> that. 

Can your query consist of more than one words?

> However, wildcards cannot be used at the beginning of query so I
> guess I can live with only being able to startsWith type matching until
> that is fixed. 

With solr.ReversedWildcardFilterFactory it is possible. But it is in 1.4.0.

> For now I have tried to do that using this:
> query = (summary:"my item" || summaryExact:"my item*"^3)
> but I would do this if I could:
> query = (summary:"my item" || summaryExact:"*my item*"^3)

If you use string type for summaryExact you can run this query summaryExact:my\ 
item* It will bring you all documents begins with my item.
 
> The idea is that a "phrase" match would be boosted over the
> normal
> token matches and would show up first in the listing. Let
> me know if
> more examples would help. I am happy to provide them.

More examples will be great. Because boosting phrase match on a tokenized field 
can be achieved by something like "my item"^5 my item
I didn't understand need of * operator. 
Also this query will retrieve documents below:

something my item something
my something item something

We can say that it already behaves %like% query.


      

Reply via email to