[Xapian-discuss] 回复: range query for terms

zjc5415 zjc5415 at 163.com
Wed Apr 1 14:50:53 BST 2015


Databases will be dynamiclly Cruded(create.Retrieve.update.delete)
So do Fields for each database.
To avoid map syn and lock, l'd rather use hash.  
By saying" add a small overhead ...", does it mean a random slot number only affect the size of each doc ,without other side effects?

来自我的华为手机

Olly Betts <olly at survex.com>编写:

>On Sun, Mar 29, 2015 at 07:07:25PM +0800, 张吉财 wrote:
>> now I am trying to index docs in json format, and came to a question
>> about prefix mapping:
>> a json doc like:    {"starttime":1111,"endtime":2222}
>> considerring mapping prefix to slot number in two ways:
>> 1.starttime-->0,endtime--->1
>> 2.startime--->hash(starttime), endtime--->hash(endtime), while
>> hash(key) is a random int, which may be very sparse but unique, for
>> example, using BKDR hash.
>> 
>> after simple test, both ways seemed to work well. can I use the second
>> way(do not have to maintain a mapping), is there performance issues?
>
>It'll add a small overhead to anywhere that has to store the value slot
>number.  Also, you have to worry what to do if two fieldnames hash to
>the same value...
>
>If you can't have a static mapping, I'd just store the mapping in the
>user metadata, then it's there with the database, and any changes are
>committed in sync with corresponding changes to the database.
>
>Cheers,
>    Olly


More information about the Xapian-discuss mailing list