Babzsak / duke

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

Save/Retrieve multiple property values in the lucene database #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

 I would like to indexing a record in which a property has >1 values.
At the moment I can see that only 1st value gets saved in the lucene database:

String value = record.getValue(propname);

 So that when a candidate is retrieved from the database all other values are lost and the comparison is not what I'd like it to be.

 Would it be possible to correctly save/retrieve the whole collection of property values in the database?

Thanks

Original issue reported on code.google.com by ale...@yoxel.com on 13 Jun 2011 at 6:32

GoogleCodeExporter commented 8 years ago

Original comment by lar...@gmail.com on 13 Jun 2011 at 12:20

GoogleCodeExporter commented 8 years ago
Fixed.

Original comment by lar...@gmail.com on 13 Jun 2011 at 12:57

GoogleCodeExporter commented 8 years ago
 I did hg pull but can't seem to see the fix.
Am I updating my working mercurial dir incorrectly?

Original comment by ale...@yoxel.com on 13 Jun 2011 at 7:13

GoogleCodeExporter commented 8 years ago
I see, I also need to do hg update ...

Original comment by ale...@yoxel.com on 13 Jun 2011 at 8:25

GoogleCodeExporter commented 8 years ago
Hi Lars, there is still a bug in retrieving the multiple values.
r2.getValues(propname) - this one still returns only a Collection.singleton()

public double compare(Record r1, Record r2) {
double prob = 0.5;
    for (String propname : r1.getProperties()) {
      Property prop = database.getPropertyByName(propname);
      if (prop.isIdProperty())
        continue;

      Collection<String> vs1 = r1.getValues(propname);
      Collection<String> vs2 = r2.getValues(propname);

Original comment by ale...@yoxel.com on 14 Jun 2011 at 6:01

GoogleCodeExporter commented 8 years ago
Ah, true. I need some unit tests for the core engine to avoid this sort of 
error.

Original comment by lar...@gmail.com on 14 Jun 2011 at 7:02

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I've fixed this now, and also added a test case for it: 
http://code.google.com/p/duke/source/browse/src/test/java/no/priv/garshol/duke/t
est/DocumentRecordTest.java#49

Original comment by lar...@gmail.com on 15 Jun 2011 at 7:47