[Xapian-discuss] Cannot index with dynamic spelling data (Perl/Search::Xapian)

Jim Lynch jim at fayettedigital.com
Mon Oct 25 21:37:30 BST 2010


I stand corrected, it is in the API, 
http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html.

I was apparently looking at an old document tree.

Jim.
On 10/25/2010 01:40 PM, Jim Lynch wrote:
> Note in http://xapian.org/docs/spelling.html, about 1/3 of the way 
> down the page, the sentence, "Note that you must call the 
> set_database() method as well as setting FLAG_SPELLING so that Xapian 
> knows where to add the spelling dictionary entries."
>
> Not real obvious, however.  I'd like the API to also mention that fact.
>
> Jim.
> On 10/24/2010 09:00 PM, Jim Lynch wrote:
>> On 10/24/2010 07:42 PM, Marinos Yannikos wrote:
>>> #!/usr/bin/perl
>>>
>>> use Search::Xapian qw(:all);
>>> use strict;
>>>
>>> my $xa = new Search::Xapian::WritableDatabase ("/tmp/xapian",
>>>            DB_CREATE_OR_OVERWRITE);
>>>
>>> my $indexer = Search::Xapian::TermGenerator->new();
>>> $indexer->set_flags(Search::Xapian::FLAG_SPELLING);
>>>
>>> my $doc = new Search::Xapian::Document;
>>> $indexer->set_document($doc);
>>> $indexer->index_text("hello 123 blah blah");
>>>
>>> $xa->add_document($doc); 
>>
>> Try this:
>>
>> #!/usr/bin/perl
>>
>> use Search::Xapian qw(:all);
>> use strict;
>>
>> my $xa = new Search::Xapian::WritableDatabase ("/tmp/xapian",
>>            DB_CREATE_OR_OVERWRITE);
>>
>> my $indexer = Search::Xapian::TermGenerator->new();
>> $indexer->set_database($xa);
>> $indexer->set_flags(Search::Xapian::FLAG_SPELLING);
>>
>> my $doc = new Search::Xapian::Document;
>> $indexer->set_document($doc);
>> $indexer->index_text("hello 123 blah blah");
>>
>> $xa->add_document($doc);
>>
>> I think it needs to know what database to do the spelling check on.
>>
>> Jim.
>>
>>
>> _______________________________________________
>> Xapian-discuss mailing list
>> Xapian-discuss at lists.xapian.org
>> http://lists.xapian.org/mailman/listinfo/xapian-discuss
>>
>
>
> _______________________________________________
> 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