similar to: setting the default operator on a QueryParser

Displaying 20 results from an estimated 1000 matches similar to: "setting the default operator on a QueryParser"

2006 Apr 13
3
QueryParser doesn''t use StandardAnalyzer correctly?
I am having a bit of a problem with my search queries being parsed correctly it seems, and I wonder if anyone else has experienced this. I have written an index using StandardAnalyzer for analysis. I want to search that index by passing my user query through a QueryParser instance which is also using a StandardAnalyzer. However the resultant query does not seem to be a valid term query and
2006 Jun 27
2
Using QueryParser vs building my own query
Hello all I finally caved in and decided I should build my own query instead of relying on QueryParser to do the job for me, but I''ve hit a strange problem.. Here''s how I build my query: #Main query query = Ferret::Search::BooleanQuery.new #Build query to match types typesquery = Ferret::Search::BooleanQuery.new @selected_types.each{|type| typesquery.add_query(
2007 Sep 27
5
QueryParser.parse question
Hi there, I am stomped as to why QueryParser''s parse method behaves differently between query ''a'' and ''b''. See http://pastie.caboo.se/private/4rlwrecyyow3yl6qtf4tq Could someone please help me understand why that is the case. p.s. I also found ''i'' produce the same behavour as ''a'' Cheers, Andy
2018 Mar 21
3
Mean of a row of a data frame
I am trying to get the mean of a row of a data frame. My code follows: roop <- data.frame(x=c(1,2,3),y=c(4,5,2),z=c(0,9,4)) roop mean(roop[1,]) mean(roop[1,c("x","y","z")]) I get the following output: > roop x y z 1 1 4 0 2 2 5 9 3 3 2 4 > mean(roop[1,]) [1] NA Warning message: In mean.default(roop[1, ]) : argument is not numeric or logical:
2018 Mar 21
0
Mean of a row of a data frame
R > rowMeans(roop) [1] 1.666667 5.333333 3.000000 R > mean(as.numeric(roop[1,])) [1] 1.666667 :-) > On Mar 20, 2018, at 10:18 PM, Sorkin, John <jsorkin at som.umaryland.edu> wrote: > > I am trying to get the mean of a row of a data frame. My code follows: > > > roop <- data.frame(x=c(1,2,3),y=c(4,5,2),z=c(0,9,4)) > roop > mean(roop[1,]) >
2006 Dec 08
6
QueryParser Exception Handling Problem
According to the following link: http://ferret.davebalmain.com/api/classes/Ferret/QueryParser.html :handle_parser_errors => true is enabled by default and seems to be in acts_as_ferret in class_methods.rb of the plugin. However, when I pass a special character as a query (e.g., !, -, <, >, etc) it throws an error and pukes. -- snip -- Error occured in src/q_parser.y:279 - yyerror
2006 Apr 03
4
Stop words in queries
I''ve run in to an issue that I''m not sure how to address. Basically, I''m building queries with occur_default Search::BooleanClause::Occur::MUST, and using the StandardAnalyzer which does stop filtering. The stop filtering is working beautifully on the indexing side. The problem is that when the query parser parses through a query with a stop word in it, say
2006 Aug 28
1
How should this be done with ferret 0.10.1
Hi i like the new version of ferret, has solved a few of my problems but i''m unsure of how to implement the following code in the new version of ferret? if section if !section.empty? qp = Ferret::QueryParser.new("section") query = qp.parse("\"#{section}\"") bq.add_query(query, Ferret::Search::BooleanClause::Occur::MUST) filter_on =true end
2012 Jan 04
2
[issue] The difference between QueryParser::FLAG_AUTO_SYNONYMS and QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS
I don't know whether this is a BUG or for special purpose... According to the definition of "xapian/queryparser.h", FLAG_AUTO_MULTIWORD_SYNONYMS contains bit of FLAG_AUTO_SYNONYMS . Therefore, long as I set the parse flag with FLAG_AUTO_SYNONYMS, the query parser will automatically activate the function of FLAG_AUTO_MULTIWORD_SYNONYMS. See the below source code part from
2010 Nov 02
1
How to make QueryParser select entire word like "H.O.T"
Hi, I'm using xapian to build my search engine, but met with a problem. The code snippet is like: ----------------------Code begin------------------------------------------------------------- Xapian::QueryParser qp; qp.add_prefix("Singer", "S"); Xapian::Query query = qp.parse_query("Singer:s.h.e",
2006 Sep 22
1
QueryParser bug?
I cooked up a little script to show what I mean. This doesn''t look right to me, but maybe I just completely misunderstand QueryParser. Same output on mswin32, unix, ferret 0.9 and 0.10 Cheers, Sam require ''rubygems'' require ''ferret'' p Ferret::VERSION # 0.10.6 index = Ferret::Index::Index.new() index << {:title => "Programming
2006 Jul 21
3
segfaulting at rebiuild_index
Hello, I can''t figure out how to get acts_as_ferret to stop segfaulting. Every time i run a query on my server (rails 1.1.4 and ferret .9.4 and aaf from svn) I get a segfault ./script/../config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:243: [BUG] Segmentation fault this line is where the indx is rebuilt. " def rebuild_index(*additional_models)
2006 May 31
5
Help with sorting arrays with objects in it
I have to build an array through both activerecord and also through a ferret index. I was hoping to find a way of sorting the array as i combine the two so def advanced_search(search_text, store, format, sortby) # find items in ferret index items = Item.find_by_contents(search_text) # and now find all the items from a certain store or category items_from_sql = Item.find_by_sql("SELECT *
2009 Jan 10
2
QueryParser::parse_query() uses OR by default? How to switch to AND?
I use the QueryParser::parse_query() method but I see it uses "OR" by default between words? Is there a way to make it use "AND" instead? I see there are flags I can pass to the parse_query() method but none seems to allow a switch from OR to AND. I would like to do that without having to write my own query parser. Everything else is fine with the QueryParser parsing, for
2005 Aug 22
2
queryparser dies badly on double search words.
hey. I'm using the Search::Xapian interface version 0.9.2 (and xapian-core 0.9.2), and feeding the queryparser such things as "one AND NOT two" or "test NOT NOT really" makes it go "Aborted"... I've tried adding the exception handling from the other stubs to QueryParser.xs as well, but I still can't catch this error from perl. Does this mean
2012 Mar 11
1
GSOC 2012: Dynamic Snippets and QueryParser Reimplementation
Hello, My name is Sean Mikalson. I am a second year Software Engineering student with a combined degree in Philosophy. I am interested in participating with Xapian in GSOC this year and a couple of projects have initially caught my eye: - Dynamic Snippets - QueryParser Reimplementation I have good working knowledge in C/C++, Java and SQL (specifically Transact-SQL). In order to determine
2006 Oct 30
1
QueryParser and prefixes
Hi all, My app uses prefixes for user-defined labels and directory names. Since these are case-sensitive, I chose XLABEL and XDIR respectively. Labels and directories may start with an upper-case, so a ":" is always inserted between the prefix and the term itself. These prefixes are mapped with add_boolean_prefix to "dir" and "label". Let's imagine I index a
2006 May 17
3
QueryParser lowercase / uppercase and stemming
Hello. There are several problems I couldn't find a solution. 1. QueryParser does not perform stemming I am working with PHP5 and use the xapian wrapper written by Daniel M?nard I build a query using parseQuery. Output of the parsed query shows that terms are not stemmed, although a stemmer is set ( see code snippet) # create a XapianDatabase object to search in $db = new
2006 Oct 16
2
Ferret::QueryParser::QueryParseException
During our last week of Ferret / aaf usage (also our first week of Ferret / aaf usage), I have received 8 messages stating that our app encountered a Ferret::QueryParser::QueryParseException. For instance: A Ferret::QueryParser::QueryParseException occurred in foo#search: Error occurred in src/q_parser.y:279 - yyerror couldn''t parse query "com -- 404". Error message
2006 Aug 20
7
missing terms in index causing search errors
I am unable to find results for models when one or more of the terms are not being indexed. Lets suppose I index a User on the phrase "Ruby on Rails." If I then search using User.find_by_contents("Ruby on Rails") I get no results, since "or" is a common term and does not get indexed. Of course, User.find_by_contents("Ruby Rails") works just fine. I