tjake / Solandra

Solandra = Solr + Cassandra
Apache License 2.0
882 stars 150 forks source link

Phrase search #55

Closed heyvishy closed 13 years ago

heyvishy commented 13 years ago

Hi Jake, The phrase query does not work in Lucandra. So, For e.g if indexed data is CITY_EQUAL:new haven and i query with below query CITY_EQUAL:"new haven", i do not get any results.

The same query works if the data is indexed into file segments,using Apache Lucene,

So i am suspecting it's a bug in Lucandra search API.

please take a look.

tjake commented 13 years ago

Hi, What branch is this happening on?

heyvishy commented 13 years ago

this is happening in 0.7 branch.

tjake commented 13 years ago

What flags are you storing the field with?

I have a testExactQuery() case in LucandraTests does this fail for you?

heyvishy commented 13 years ago

I am using Store.YES and Index.ANALYZED flags. So for e.g. any entry added into document is like, doc.add(new Field(rule, value, Store.YES, Index.ANALYZED)); where rule , value are variables.

i tested testExactQuery() , and it failed. However, the testCase testWriter() passed.

davidstrauss commented 13 years ago

I seem to be running into this issue, too.

davidstrauss commented 13 years ago

Here's a way to reproduce the issue:

  1. Download and index the Reuters data.
  2. curl "http://localhost:8983/solandra/reuters/select?q=arden" # Returns results
  3. curl "http://localhost:8983/solandra/reuters/select?q=arden%20group" # Returns results
  4. curl "http://localhost:8983/solandra/reuters/select?q=%22arden%20group%22" # Doesn't return results, but should

Tested on a build of commit 9078ad30e54087731dc4, which is the current HEAD.

ceocoder commented 13 years ago

@davidstrauss if you change your schema.xml L225 to ,

https://gist.github.com/967633

http://localhost:8983/solandra/reuters/select?q=text:"difficult times"

phrase search should work, solandra needs termPositions="true" in order to perform phrase search

davidstrauss commented 13 years ago

@ceocoder Awesome. That seems to do the trick!