search for: set_stemming_strategy

Displaying 18 results from an estimated 18 matches for "set_stemming_strategy".

2015 Jul 26
1
Get term from document by position
...why you?re just getting the start of the document. However if I adjust things (match the stemming strategy for TermGenerator to that for QueryParser), it still gives me the opening rather than a useful snippet. Sorry, my mistake. The modified test.cpp file should be this (i just added indexer.set_stemming_strategy(Xapian::TermGenerator::STEM_ALL_Z), line 34): ============= Begin of the modified test.cpp file========= #include <xapian.h> #include <iostream> #include <string> #include <cstdlib> // For exit(). #include <cstring> #include <fstream> class MyText { public:...
2013 Sep 02
2
having trouble with prefixes
...arser.add_prefix("type", "T"); queryparser.add_prefix("md5sum", "Q"); queryparser.add_prefix("path", "P"); queryparser.add_prefix("extension", "E"); //maybe set stemming strategy here (in query parser)? queryparser.set_stemming_strategy(QueryParser::STEM_NONE); Query query(queryparser.parse_query(full_string)); cout<<"Query is '"<<full_string<<"'"<<endl; Enquire enquire(db); enquire.set_query(query); MSet match_set(enquire.get_mset(0, 10)); for_each(match_set.begin(), match...
2018 Nov 30
1
Xapian Benchmark results
...reads,vector<string> documents,Xapian::WritableDatabase *db ) { int i =0; char line[2048]; string line_string; Xapian::TermGenerator indexer; Xapian::Stem stemmer("english"); indexer.set_stemmer(stemmer); // doc.set_data("content"); indexer.set_stemming_strategy(Xapian::TermGenerator::STEM_SOME); Xapian::WritableDatabase database = *db; try{ for(i=0;i<documents.size();++i) { ifstream file; file.open(documents[i]); line_string = ""; while(file.good()) {...
2009 Mar 02
0
Xapian, PHP bindings and
...); $rset = new XapianRSet(); $qp = new XapianQueryParser(); $stemmer = new XapianStem( 'french' ); $qp->set_stemmer($stemmer); $qp->set_database($database); $qp->set_stemming_strategy(XapianQueryParser::STEM_SOME); $query = $qp->parse_query( $query_string ); //, XapianQueryParser::FLAG_SPELLING_CORRECTION); print 'Parsed query is: '. $query->get_description() .'<br />'."\n"; // Find the t...
2009 Aug 17
1
Xapian DatabaseError
...n simpleSearch($query,$path){ try { $database = new XapianDatabase($path); $enquire = new XapianEnquire($database); $qp = new XapianQueryParser(); $stemmer = new XapianStem("italian"); $qp->set_stemmer($stemmer); $qp->set_database($database); $qp->set_stemming_strategy(XapianQueryParser::STEM_SOME); $query = $qp->parse_query($query); echo "<br>Parsed query is: {$query->get_description()}\n"; $enquire->set_query($query); $matches = $enquire->get_mset(0, 10); ...... ?> 3) To test...
2010 Mar 31
1
Hyphen search with parse_query()
...different from "peterbengtsson") and find it. To start with I'm trying to use a basic python script to get to grips with it. When I do this:: qp = xapian.QueryParser() stemmer = xapian.Stem("english") qp.set_stemmer(stemmer) qp.set_database(database) qp.set_stemming_strategy(xapian.QueryParser.STEM_SOME) print "Query string is:", repr(query_string) query = qp.parse_query(query_string) print "Parsed query is: %s" % str(query) I get the following output:: Query string is: 'peter-bengtsson' Parsed query is: Xapian::Query((ssh...
2011 Sep 30
1
Slow phrase performance
...f matches, but that doesn't seem to help on common terms. I am not limiting the number of matches -- I want all of them. But even on small sets like "kansas state" with just 334 results, it's taking a long time. The following are set: $qp->set_default_op(OP_AND); $qp->set_stemming_strategy(STEM_NONE); Flags enabled: BOOLEAN,BOOLEAN_ANY_CASE,WILDCARD,PHRASE ------------------------------ I have been unable to find reports of other people experiencing the same problem with poor phrase performance, so I am hoping it's simply something that I'm doing wrong or ineffectively. An...
2012 Jun 04
1
Search not finding queries with stop words.
I have a search in perl that looks a bit like: my $qp = new Search::Xapian::QueryParser(); $qp->set_stemmer(new Search::Xapian::Stem("english")); $qp->set_stemming_strategy(STEM_SOME); $qp->set_default_op($defaultop); ... my $par = $qp->parse_query($query); my $enq = $xDatabase->enquire( $par ); and in the db create script: my $stopper = Search::Xapian::SimpleStopper->new(); foreach my $word (@ar) { $stopper->add($word); } ......
2013 Aug 21
2
Perl interface isn't working in 1.2.x
At least it isn't working the way it used to. Code: $db = Search::Xapian::Database->new( $dx ); my $qp = Search::Xapian::QueryParser->new(); my $dbSize=$db->get_doccount(); # $qp->set_stemmer(new Search::Xapian::Stem("english")); # $qp->set_stemming_strategy(STEM_SOME); # $qp->set_default_op($defaultop); my $par = $qp->parse_query($query); my $enq = $db->enquire( $par ); my @matches = $enq->matches($nstart,$nrecords); my $mset = $enq->get_mset($nstart,$nrecords); my $est = $mset->get_matches_estimated();...
2007 May 30
1
QueryParser prefixing terms when stemming?
...uld be written. In version 0.9.9.1 of Search::Xapian, the following code results in this output "Xapian::Query(pet:(pos=1))". my $qp = new Search::Xapian::QueryParser; $qp->set_stemmer(new Search::Xapian::Stem('english')); $qp->set_default_op(OP_AND); $qp->set_stemming_strategy(STEM_SOME); warn $qp->parse_query($search_term); In version 1.0.0.0, the same code results in "Xapian::Query(Zpet: (pos=1))". The result is no matches, even though the term pet exists. If I use STEM_NONE, the output is the same as the output from 0.9.9.1 and there are match...
2010 Oct 28
1
hypens in words + NEAR + 3 terms + AND_MAYBE => crash
...strategy STEM_SOME. Default op was OP_AND_MAYBE. This is the offending Perl code: [...] my $qp = Search::Xapian::QueryParser->new(); my $stemmer = Search::Xapian::Stem->new("english"); $qp->set_stemmer($stemmer); $qp->set_database($database); $qp->set_stemming_strategy(STEM_SOME); $qp->set_default_op(OP_AND_MAYBE); $query_string = " x-y NEAR test NEAR test "; my $query = $qp->parse_query($query_string, Search::Xapian::FLAG_DEFAULT); [...] Here's a gdb backtrace for a crash: Program received signal SIGSEGV, Segmentation fault....
2018 Jul 19
1
choosing between probabilistic and boolean prefixes for terms
...h::Xapian::Stem->new($LANG) } sub qp { my ($self) = @_; my $qp = $self->{query_parser}; return $qp if $qp; # new parser $qp = Search::Xapian::QueryParser->new; $qp->set_default_op(OP_AND); $qp->set_database($self->{xdb}); $qp->set_stemmer($self->stemmer); $qp->set_stemming_strategy(STEM_SOME); $qp->set_max_wildcard_expansion(100); $qp->add_valuerangeprocessor( Search::Xapian::NumberValueRangeProcessor->new(YYYYMMDD, 'd:')); $qp->add_valuerangeprocessor( Search::Xapian::NumberValueRangeProcessor->new(DT, 'dt:')); In any case, all the code...
2013 Sep 22
2
How to filter search result with query with has white space.
...qp.set_default_op(Xapian::Query::OP_FILTER); qp.set_stemmer(stemmer); qp.add_prefix("","title"); qp.add_prefix("","content"); qp.add_boolean_prefix("title","title"); qp.set_database(db); qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME); Xapian::Query query = qp.parse_query(query_string); std::cout << "Parsed query is: " << query.get_description() << std::endl; enquire.set_query(query); Xapian::MSet matches = enquire.get_mset(0, 10);...
2013 Sep 22
2
How to filter search result with query with has white space.
...qp.set_default_op(Xapian::Query::OP_FILTER); qp.set_stemmer(stemmer); qp.add_prefix("","title"); qp.add_prefix("","content"); qp.add_boolean_prefix("title","title"); qp.set_database(db); qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME); Xapian::Query query = qp.parse_query(query_string); std::cout << "Parsed query is: " << query.get_description() << std::endl; enquire.set_query(query); Xapian::MSet matches = enquire.get_mset(0, 10);...
2014 Jan 21
2
seg fault on search
...(fullDB)); Enquire enquire(db); try { Xapian::QueryParser qp; Xapian::Stem stemmer("english"); qp.set_database(db); qp.set_default_op(Query::OP_OR); qp.set_stemmer(stemmer); qp.set_stemming_strategy(QueryParser::STEM_SOME); Xapian::Query q=qp.parse_query(queryString); ... As soon as it hits the q=qp.parse_query line it gets the seg fault. The function is called like so: int main (int argc, char* const argv[]) { int i; char results[100000]; if...
2006 Nov 30
1
PHP / XapianQueryParser
...retty sure it is :)) I'm trying to use the XapianQueryParser (in PHP5), but I get an error everytime. $odb = new XapianDatabase($db); $ostem = new XapianStem("en"); $oqparser = new XapianQueryParser();$oqparser->set_stemmer($ostem);$oqparser->set_database($odb);$oqparser->set_stemming_strategy(1);$oqparser->add_boolean_prefix("Q",1);$oquery = $oqparser->parse_query($query, 1); I found some perl examples and 'ported' it over to the PHP version. Varying the flags (like XapianQueryParser::FLAG_PHRASE) or the boolean_prefix, etc. does not influence anything. I tried...
2013 Aug 26
2
Perl interface isn't working in 1.2.x
On 08/25/2013 05:02 PM, Olly Betts wrote: > So the simple fix is > probably just to install the perl-Search-Xapian RPM instead. Thanks, the Centos 6 repos don't have that rpm and the http://xapian.org/download page seems to only cover the XS bindings, if I am reading this correctly: But I was able to remove the rpm packages and compile and install the core and swig from source.
2006 Dec 06
1
Bug and patch for +terms with wildcards
...t count for a wildcard query +static bool test_wildquery1() +{ + Xapian::QueryParser queryparser; + unsigned flags = Xapian::QueryParser::FLAG_WILDCARD | + Xapian::QueryParser::FLAG_LOVEHATE; + queryparser.set_stemmer(Xapian::Stem("english")); + queryparser.set_stemming_strategy(Xapian::QueryParser::STEM_ALL); + Xapian::Database db = get_database("apitest_simpledata"); + queryparser.set_database(db); + Xapian::Enquire enquire(db); + + Xapian::Query qobj = queryparser.parse_query("th*", flags); + enquire.set_query(qobj); + Xapian::MSet...