[Xapian-discuss] uniq elements or check for exists

岳帅杰 ysj.ray at gmail.com
Thu Nov 5 14:55:17 GMT 2009


I think you can solve this problem like this:

Store the md5 value of each document in its value slot, then check every string's md5 if it is exists in the database before add it.(Using OP_VALUE_RANGE to query it).
This may be a little slow, but if you needn't add too many document once, it will not be a big problem.


If you need to add much documents once, I recommend you to use a simplest way: record all the document's or theirs md5 values in to memory, then check if a document or its md5 value exists. ^_^



2009-11-05 



 Best wishes from ray.



发件人: Den no 
发送时间: 2009-11-05  22:43:14 
收件人: Xapian Discussion 
抄送: 
主题: Re: [Xapian-discuss]uniq elements or check for exists 
 
Hello,
I'm not sure that is something that should 
Here's an example for you: 
are 4 lines: 
1) my string n1 
2) my string n2 
3) my string n3 
4) my string n1 
when added to the database, should only add a line under the numbers: 1, 2, 3 
Line number 4, is not unique, it is the same as a string of number 1 
how to do it in xapian?
_______________________________________________
Xapian-discuss mailing list
Xapian-discuss at lists.xapian.org
http://lists.xapian.org/mailman/listinfo/xapian-discuss


More information about the Xapian-discuss mailing list