healthonnet / hon-lucene-synonyms

Solr query parser plugin that performs proper query-time synonym expansion.
http://nolanlawson.com/2012/10/31/better-synonym-handling-in-solr
150 stars 67 forks source link

Bug in #41 fix for Solr 5.3.1 #51

Closed joekiller closed 8 years ago

joekiller commented 8 years ago

Working on an upgrade to 5.3.1. Bug #41 was fixed but with 5.3.1 another bug appears. The last test fails because the result is:

['"man\'s best friend"', 'canis familiaris', 'dog', 'hound', 'pooch']

instead of

['"canis familiaris"', '"man\'s best friend"', 'canis familiaris', 'dog', 'hound', 'pooch']

Here is the output:

$ nosetests test/
.................F
======================================================================
FAIL: test_queries (015-test-issue-41.TestBasic)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "hon-lucene-synonyms/test/015-test-issue-41.py
    self.tst_query('canis familiaris', 4)
  File "hon-lucene-synonyms/test/015-test-issue-41.py
    self.assertEqual(cnt, quote_cnt)
AssertionError: 2 != 4
-------------------- >> begin captured stdout << ---------------------
['"canis familiaris"', '"dog"', '"hound"', '"man\'s best friend"', '"pooch"']
Quotes found count =  10
['"canis familiaris"', '"dog"', '"hound"', '"man\'s best friend"', '"pooch"']
Quotes found count =  10
['"canis familiaris"', '"dog"', '"hound"', '"man\'s best friend"', '"pooch"']
Quotes found count =  10
['"canis familiaris"', '"dog"', '"hound"', '"man\'s best friend"', '"pooch"']
Quotes found count =  10
['"canis familiaris"', '"man\'s best friend"', 'dog', 'hound', 'pooch']
Quotes found count =  4
['"canis familiaris"', '"man\'s best friend"', 'dog', 'hound', 'pooch']
Quotes found count =  4
['"canis familiaris"', '"man\'s best friend"', 'dog', 'hound', 'pooch']
Quotes found count =  4
['"man\'s best friend"', 'canis familiaris', 'dog', 'hound', 'pooch']
Quotes found count =  2

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 18 tests in 2.058s

FAILED (failures=1)

Not sure the problem immediately but working on it...

joekiller commented 8 years ago

I'm not positive but I think this has to do with https://issues.apache.org/jira/browse/LUCENE-6400

nolanlawson commented 8 years ago

Fixed in 2.0.0; thanks a ton for your PR! :)

BTW you are now a collaborator on this project. Feel free to +1 and merge pull requests; it's a pretty lax environment, but I think now that we have Travis tests, we should at least try to keep the badge green. :)

joekiller commented 8 years ago

Sounds good thanks! I think we can close this as it was more of a lucene change and to make it known how it affected the plugin.