search for: booleanclause

Displaying 20 results from an estimated 22 matches for "booleanclause".

2006 Jun 27
2
Using QueryParser vs building my own query
...uery: #Main query query = Ferret::Search::BooleanQuery.new #Build query to match types typesquery = Ferret::Search::BooleanQuery.new @selected_types.each{|type| typesquery.add_query( Ferret::Search::TermQuery.new(Ferret::Index::Term.new(''type'', type)), Ferret::Search::BooleanClause::Occur::SHOULD ) } #Add types query to main query query.add_query(typesquery, Ferret::Search::BooleanClause::Occur::MUST) #Build query to match content and title contenttitlequery = Ferret::Search::BooleanQuery.new contenttitlequery.add_query( Ferret::Search::TermQuery.new(Ferret::Index::Term...
2006 Jul 09
3
acts_as_ferret.. what does it actually do?
...'short_description'',''section'',''sale_category'',''sale_type'',''outcode''] def VoObject.refine_search(search_input) bq = BooleanQuery.new bq.add_query(TermQuery.new(Term.new("section", search_input), BooleanClause::Occur::Should)) filter = QueryFilter.new(bq) @vobjects = Item.find_by_contents(search_text,:filter => filter, :sort => ["section", "sale_category"]) redirect_to :results end ############ I get this ############## ruby script/console Loading development env...
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 th...
2006 Sep 04
5
uninitialized constant BooleanClause
I''ve installed the latest Win32 gem and the acts_as_ferret plugin (i checked out the files and placed them in the vendor/plugins directory). When I try to search I get the following error: uninitialized constant BooleanClause RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in `const_missing'' #{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:176:in `acts_as...
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 *
2006 Dec 21
12
Ferret and Godaddy.com
Ok, first up, I''m a Rails newbie. My site is hosted on godaddy.com Godaddy has the Ferret GEM installed by default. They do not have acts_as_ferret installed so I can''t use that. I''m trying to follow the tutorial on the Ferret wiki http://ferret.davebalmain.com/trac/wiki It includes all of the code I need, but it doesn''t tell
2006 Jul 14
3
Whitespace Issues
I am trying to build up a filtered search using the logic below. bq = Ferret::Search::BooleanQuery.new bq.add_query(Ferret::Search::TermQuery.new(Ferret::Index::Term.new("section",section.downcase!)), Ferret::Search::BooleanClause::Occur::MUST) filter = Ferret::Search::QueryFilter.new(bq) @vobjects = VoObject.find_by_contents(search_input,:filter => filter, :sort => ["section", "sale_category"]) This works fine when the "section" is a single word like "book" but wh...
2006 Aug 23
4
Ferret 0.10 and Fields
Hey ... I just tried to convert my code to 0.10 .. But i''m currently not sure how to use fields.. i really like some of the new api.. its leaner and i like the fact that these strange consts are gone (like Ferret::Search::BooleanClause::Occur::MUST) .. I see that you''re now having Ferret::Index::FieldInfo to describe the fields of the index.. thats good.. and i now see that documents and fields are much smaller and easier to create.. thats good as well :-) now what i dont get is how to add a field to a document.. i can...
2006 Jan 05
2
ActiveRecord callbacks not happening
Hi, I have a model class like so: class Candidate < ActiveRecord::Base validates_presence_of :name @@index = FerretConfig::INDEX def self.after_destroy puts "Ferret: after_destroy called" @@index.query_delete("+id:#{self.id} +ferret_class:#{self.class.name}") optimize_index end end But when I delete a record, the after_destroy is never called.
2006 Aug 28
1
How should this be done with ferret 0.10.1
...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 end Thank you for any help offered... regards Caspar -- Posted via http://www.ruby-forum.com/.
2006 Apr 11
2
setting the default operator on a QueryParser
Hi all, Thanks to the authors for the amazing work on Ferret! I have a question about setting up the standard operators on a QueryParser. I would like my parser to default to AND queries rather than the default OR. In Java I would simply do: QueryParser parser = new QueryParser("contents", new StandardAnalyzer()); parser.setDefaultOperator(QueryParser.Operator.AND); But I
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 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
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 "the oregon trail", it builds a query that looks somethi...
2019 Mar 08
0
imap segfault in libc.so with CLucene FTS backend enabled
...(lucene::search::Searcher*) () at /var/tmp/portage/dev-cpp/clucene-2.3.3.4-r6/work/clucene-core-2.3.3.4/src/core/CLucene/search/TermQuery.cpp:240 No locals. #13 0x000063e7edafa2dc in lucene::search::BooleanWeight::BooleanWeight(lucene::search::Searcher*, lucene::util::CLVector<lucene::search::BooleanClause*, lucene::util::Deletor::Object<lucene::search::BooleanClause> >*, lucene::search::BooleanQuery*) () at /usr/lib/gcc/x86_64-gentoo-linux-musl/8.2.0/include/g++-v8/bits/stl_vector.h:930 i = 1 i = <optimized out> #14 0x000063e7edafa351 in lucene::search::BooleanQuer...
2007 Jul 28
0
Problem with acts_as_ferret demo
...Jens, I copied the demo folder into my rails apps and also created the ferret_production and ferret_test databases. when I start the server and type this in the browser: localhost:3000/content I get the following error: NameError in ContentController#new uninitialized constant Ferret::Search::BooleanClause RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:263:in `load_missing_constant'' F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_s...
2006 Aug 23
0
Problem after upgrading to ferret 0.10.0
Caspar wrote: > uninitialized constant BooleanClause 0.10.0 is not compatible with 0.9.4, there are several differences that make acts_as_ferret break. -- Posted via http://www.ruby-forum.com/.
2006 Jul 03
3
Ferret not returning the right results
I have ferret setup in my model with multiple fields, but when I do a search on the value that might be stored in two fields, I get no results. Here''s an example: "Jim 12333" Where Jim is a name field, and 12333 is a zip code. I have this in my model: acts_as_ferret :fields => [ ''name'', ''zip'' ] I''m not sure
2006 Apr 13
3
QueryParser doesn''t use StandardAnalyzer correctly?
...erret, I''m at a loss. This should be easily reproducible with the following code fragment: require ''ferret'' parser = Ferret::QueryParser.new(''contents'', :analyzer => Ferret::Analysis::StandardAnalyzer.new, :occur_default => Ferret::Search::BooleanClause::Occur::MUST) q1 = parser.parse(''museum art'') q2 = parser.parse(''museum of art'') puts q1, q2 Thanks for any insight. -Roop -- Posted via http://www.ruby-forum.com/.
2019 Apr 23
2
SolrCore 'dovecot' is not available due to init failure: fieldType 'text_general' not found in the schema
Hello, it seems an mismatch of schema file provided by dovecot-2.3.5.2 [root at mail conf]# pwd /var/solr/data/dovecot/conf # Below solrconfig.xml is from Solr-8.0.0. [root at mail conf]# grep text_general solrconfig.xml <str name="queryAnalyzerFieldType">text_general</str> field types. Text content will be indexed as "text_general" as <str