PiRSquared17 / flaxcode

Automatically exported from code.google.com/p/flaxcode
0 stars 0 forks source link

Queries may not have correct stemming behaviour. #210

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Create a collection from English text with language set to English.
2. Search for some words which you expect to see in the index.
3. Differently inflected forms will give different results (they should be the 
same).

Original issue reported on code.google.com by bano...@gmail.com on 24 Mar 2009 at 2:08

GoogleCodeExporter commented 9 years ago
Code which shows the problem:

import shutil
import xappy

shutil.rmtree('TMP.db')
c = xappy.IndexerConnection('TMP.db')
c.add_field_action('f', xappy.FieldActions.INDEX_FREETEXT)

# dodgy field action - commented out, the code works
c.add_field_action('g', xappy.FieldActions.INDEX_FREETEXT, language='en')

doc = xappy.UnprocessedDocument()
doc.fields.append(xappy.Field('f', 'A New England'))
c.add(doc)
c.flush()
c.close()

c = xappy.SearchConnection('TMP.db')
q = c.query_parse('A New England')
print q
r = c.search(q, 0, 10)
assert r.matches_estimated == 1

q = c.query_parse('a new england')
print q
r = c.search(q, 0, 10)
assert r.matches_estimated == 1

Original comment by bano...@gmail.com on 30 Apr 2009 at 6:47

GoogleCodeExporter commented 9 years ago

Original comment by charliej...@gmail.com on 19 Aug 2009 at 3:37