search for: query_parse

Displaying 20 results from an estimated 35 matches for "query_parse".

Did you mean: query_parser
2006 Sep 22
1
QueryParser bug?
...require ''rubygems'' require ''ferret'' p Ferret::VERSION # 0.10.6 index = Ferret::Index::Index.new() index << {:title => "Programming Ruby", :content => "yada yada yada"} puts index.search("ruby").total_hits # returns 1 query_parser = Ferret::QueryParser.new( :default_field => :title ) query = query_parser.parse("title:ruby") puts index.search(query).total_hits # returns 1 query_parser = Ferret::QueryParser.new( ) # :default_field: Default: "*" # The default field to search when no field is specified i...
2006 Mar 29
1
Using boolean terms in PHP bindings
...C - - - - - - php - - - - - - //load the module dl ("xapian.so"); //report all errors error_reporting (E_ALL); $db = new_database ("/www/servers/util/omega/test/default"); $stemmer = new_stem ("english"); //create a query parser $query_parser = new_queryparser(); //set the stemmer and turn on the stemming strategy queryparser_set_stemmer ($query_parser, $stemmer); queryparser_set_stemming_strategy ($query_parser, 1); //set the database queryparser_set_database ($query_parser, $db); //set prefix queryparse...
2007 Sep 22
2
http helpers c extension
hi, I rewrote escape, unescape, and query_parse in a C extension. http://s3.amazonaws.com/four.livejournal/20070922/http_helpers.tar.bz2 Here are some sample benchmarks (the benchmark script is included in the package) user system total real escape: Single long Mongrel: 1.680000 0.020000 1.700000 ( 1.837793) HttpHlp...
2006 Sep 15
3
Crashes and tests failures again with 0.10.4
....rb:351: [BUG] Segmentation fault ruby 1.8.4 (2005-12-24) [i686-linux] The tests run fine on Linux, on OS X testall crashes with a segfault on test_index and several of the Ruby tests fail: 1) Failure: test_sorts(SearchAndSortTest) [./test/unit/../unit/analysis/../../unit/index/../../unit/query_parser/../../unit/search/tc_search_and_sort.rb:40:in `do_test_top_docs'' ./test/unit/../unit/analysis/../../unit/index/../../unit/query_parser/../../unit/search/tc_search_and_sort.rb:39:in `do_test_top_docs'' ./test/unit/../unit/analysis/../../unit/index/../../unit/query_parse...
2006 Jul 25
1
RDig document processing error
...index/term.rb:45: warning: method redefined; discarding old text= /usr/local/lib/site_ruby/1.8/ferret/search/sort_field.rb:69: warning: instance variable @name not initialized /usr/local/lib/site_ruby/1.8/ferret/search/sort_field.rb:69: warning: instance variable @name not initialized lib/ferret/query_parser/query_parser.y:128: warning: method redefined; discarding old initialize lib/ferret/query_parser/query_parser.y:157: warning: method redefined; discarding old parse lib/ferret/query_parser/query_parser.y:216: warning: method redefined; discarding old clean_string /usr/lib/ruby/gems/1.8/gems/rub...
2006 Aug 15
8
Ferret 0.10 series
Hi David, >> Otherwise I''m fully committed to getting 0.10 out. >> When it is out, I''d recommend getting it into your >> development app as soon as you can. Any idea of timeframe to a 0.10 alpha release? Kind Regards Neville
2008 Jan 14
3
Reading HTTP Request parameters
Hello I''ve a client which send this request to a mongrel HTTPHandler : res=Net::HTTP.post_form(URI.parse(''http://localhost:3000/test''),{"a"=>1,"b"=>2}) But in the handler I can''t read the parameters one by one, I can read the entire String only : class Serveur class MyHandler < Mongrel::HttpHandler def process(req, resp)
2007 Aug 02
1
random code questions
...28 controller = klass.build(request.body, request.params, route, response) Why not just use a typical constructor? merb_dispatcher.rb:35 raise Merb::HTTPMethodNotAllowed.new(method, allowed) Why not check for this after the action has been dispatched to the controller? controller_mixin.rb:149 def query_parse(qs, d = ''&;'') Why not offload query parsing onto Mongrel as much as possible?
2007 Sep 27
0
query string parsing C extension
....amazonaws.com/four.livejournal/20070927/qsp.tar.bz2 It uses an http11-like interface to the state machine. the escape/unescape functions are also slightly more libraryish. again, here is the about benchmark results. it seems to be about 10 times faster than the ruby functions. i''ve seen query_parse pop up in profiles of merb, one can except on query string intensive actions (forms) that this would noticeably speed up the app. user system total real escape: Single long M: 1.710000 0.030000 1.740000 ( 2.192255) Q: 0.020000 0.010000 0.030000 ( 0.032105) escape:...
2005 Dec 19
2
Parentheses for precedence?
...OT (or a preceding -) are used. For example, both of these work: (other_text:"Collaborative tools") AND other_text:podcasts (other_text:"Collaborative tools") AND (other_text:podcasts) My use of parentheses is for precedence (I assume they work that way). I quickly looked at query_parser.y, but as I''ve never used racc (or yacc), it''s not apparent to me what should be happening. Thanks! Jen
2007 Feb 26
4
Ferret 0.11.0 tests segfault
...hen I create the index (via Ferret::Index::FieldInfos#create_index). I decided to run the tests, this is what I have : $> ruby test_all.rb Loading once Loaded suite test_all Started ....................EEEEEEEE./unit/../unit/index/../../unit/store/../../unit/analysis/../../unit/utils/../../unit/query_parser/../../unit/search/tc_filter.rb:11: [BUG] Segmentation fault ruby 1.8.5 (2006-12-04) [i686-linux] Aborted Dave, any idea ? -- Posted via http://www.ruby-forum.com/.
2011 Sep 23
2
understanding stemming and synonyms
...ENT: fahrrad DOCUMENT: Document(Xapian::Document::Internal(data=`fahrrad', terms[2])) TERM: Zfahrrad TERM: fahrrad INSERT DOKUMENT: fahrraeder DOCUMENT: Document(Xapian::Document::Internal(data=`fahrraeder', terms[2])) TERM: Zfahrrad TERM: fahrraeder That looks fine, but when i now use the query_parser with stemmer (german2 & STEM_ALL) and parse_query (FLAG_AUTO_SYNONYMS), i get this queries: ENTER QUERY: bike [QUERY: Xapian::Query(bik:(pos=1))] [RESULTS: 0] ENTER QUERY: fahrrad [QUERY: Xapian::Query((fahrrad:(pos=1) SYNONYM Zbik:(pos=1)))] [RESULTS: 2] ENTER QUERY: fahrraeder [QUERY:...
2006 Nov 13
6
mongrel_upload_progress question/possible suggestion
...p. Thus, the ability for path_info to be a regex instead of just a string, thus allowing for: return unless params[''PATH_INFO''] =~ @path_info && params[Mongrel::Const::REQUEST_METHOD] == ''POST'' && upload_id = Mongrel::HttpRequest.query_parse (params[''QUERY_STRING''])[''upload_id''] Then I just update my handler like so: uri "/", :handler => plugin("/handlers/upload", :path_info => %r{/account/\d/\d/media/upload}), :in_front => true And everything works fine... It'...
2006 Oct 15
12
Very small scores for search results
Hi Everyone, I''m using Ferret 0.10.11 with acts_as_ferret from SVN (same results with 0.10.10 and 0.10.9 though). I''m running into an odd problem where the scores of my top-ranking search results are ridiculously small - even when the query is one that should match at least one document with a decent score. To give an example, I have just the names of 5 businesses indexed
2006 May 11
6
problem with solaris install
I was trying to install ferret 0.9.2 on solaris (SunOS 5.8) which does not have a sys/dir.h nix_io.c:5:21: sys/dir.h: No such file or directory make: *** [nix_io.o] Error 1 I couldn''t find an obvious way around this... any suggestions? Thanks, Rich Marisa Cornell Information Technologies Cornell University
2005 Dec 02
43
ANN: acts_as_ferret
...quot;#{RAILS_ROOT}/db/index.db" def self.reloadable?; false end # Finds instances by file contents. def find_by_contents(query, options = {}) index_searcher ||= Search::IndexSearcher.new(INDEX_DIR) query_parser ||= QueryParser.new(index_searcher.reader.get_field_names.to_a) query = query_parser.parse(query) result = [] index_searcher.search_each(query) do |doc, score| id = index_searcher.reader.get_document(do...
2005 Dec 02
43
ANN: acts_as_ferret
...quot;#{RAILS_ROOT}/db/index.db" def self.reloadable?; false end # Finds instances by file contents. def find_by_contents(query, options = {}) index_searcher ||= Search::IndexSearcher.new(INDEX_DIR) query_parser ||= QueryParser.new(index_searcher.reader.get_field_names.to_a) query = query_parser.parse(query) result = [] index_searcher.search_each(query) do |doc, score| id = index_searcher.reader.get_document(do...
2006 Mar 29
1
Problems with Ferret 0.9.0
Hi, I upgraded from 0.3.2 to 0.9.0, and now my old search code doesn''t work anymore. I get a lot of ArgumentErrors, for example: "query.add_clause(Search::BooleanClause.new(query_parser.parse(term), Search::BooleanClause::Occur::MUST))" raises: ArgumentError (wrong number of arguments (2 for 0)) "index_searcher.search_each(query)" raises: ArgumentError (wrong number of arguments (1 for 2)) These shouldn''t happen according to the Api doc. You...
2007 Dec 31
2
"and" without boolean operators
Salve, Thank you very much for your kind answer. Spelling correction works very well now. I have just one more question. I am using Xapian::QueryParser() to create the Query. The flags are: FLAG_PHRASE | FLAG_LOVEHATE | FLAG_WILDCARD If I search, lets say for "king queen" (without quotes), I get all documents with either "king" or "queen". Is there a chance to
2006 May 05
1
Is there any working way to search multiple indexes?
I''m running from the trunk, and hitting road blocks no matter which way I attempt to search across multiple indexes. I tried a MultiSearcher, but I can''t pass a string for the search query ms.search "iraq" TypeError: wrong argument type String (expected Data) So I tried creating a QueryParser to pass, but I can''t get the fields from the reader