search for: booleanquery

Displaying 20 results from an estimated 26 matches for "booleanquery".

Did you mean: boolean_query
2006 Jun 11
3
Bus Error with Ferret 0.9.3 using the BooleanQuery api
Hey guys, I''ve been trying out ferret 0.9.3 on my powerbook this weekend and I''ve been triggering ''bus errors'' when using the Query API. If I programmatically build up strings, it works just fine. There''s some more information available in the trac ticket http://ferret.davebalmain.com/trac/ticket/62 Is anyone successfully using the Query API on
2006 Jul 09
3
acts_as_ferret.. what does it actually do?
...e index is generated and searchable so i assumed that i would be able top use Ferret methods (other than the ones in acts as ferret)in my application. when i try the code at the bottom of this post i get the following errors (also in full at the bottom of post) NameError: uninitialized constant BooleanQuery So this means the rails/ruby/ is not seeing ferret right? so how do i get rials to be able to see ferret? I have tried many variations on include/require/ferret_config.rb but am obviously not getting it. Do i need to do something extra if i want to simplicity of acts_as_ferret and the power of...
2005 Dec 14
2
undefined method `add'' for Ferret::Search::BooleanQuery
...39;testing'') do |d, s| ... end everything worked fine. But now when I do something like this: count = index.search_each(''contents:"testing|trucks"'') do |d, s| ... end I get the following error: undefined method `add'' for #<Ferret::Search::BooleanQuery:0x3787b10> Trace is: c:/ruby/lib/ruby/gems/1.8/gems/ferret-0.3.1/lib/ferret/search/multi_phrase_query.rb:170:in `rewrite'' c:/ruby/lib/ruby/gems/1.8/gems/ferret-0.3.1/lib/ferret/search/multi_phrase_query.rb:169:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/ferret-0.3.1/lib/ferret/s...
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( Ferret::Search::TermQuery.new(Ferret::Index::Term.new(''type'', type)), Ferret::Search::BooleanClause::Occur::SHOULD ) } #Add types query to...
2006 Aug 02
2
too many clauses exception
hey.. i get this error quite regularly, what exactly dies it mean? : Error occured at <q_prefix.c>:54 Error: exception 6 not handled: Too many clauses am i adding to many clauses in the query statement? Ben
2006 May 26
8
Comparing two documents in the index
I want to compare two documents in the index (i.e. retrieve the cosine similarity/score between two documents term-vector''s). Is this possible using the standard Ferret functionality? Thanks in advance, Jeroen Bulters -- Posted via http://www.ruby-forum.com/.
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 =&g...
2019 Mar 08
0
imap segfault in libc.so with CLucene FTS backend enabled
.../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::BooleanQuery::_createWeight(lucene::search::Searcher*) () at /var/tmp/portage/dev-cpp/clucene-2.3.3.4-r6/work/clucen...
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 Sep 22
1
Query Objects vs. Query Strings
Hi .. I tried to build some query objects to get some documents from my index.. without success.. Is something wrong here? q = Ferret::Search::BooleanQuery.new q1 = Ferret::Search::TermQuery.new(:type, "movie") q2 = Ferret::Search::TermQuery.new(:name, "Indiana") q.add_query(q1, :should) q.add_query(q2, :should) Indexer.index.search_each(q) do |doc, score| puts doc end 0 Indexer.index.search_each(q.to_s) do |doc, score| puts doc e...
2007 May 16
7
bilingual site: exclude fields set from query
Hi all, Is there a way to have searches no use some indexed fields, when processing a query? context: I have a model Foo that holds some information in two languages : - text1_nl, text2_nl, text3_nl and - text1_en, text2_en, text3_en Some other fields are common to both languages and indexed as well - first_name, last_name Depending on the visitor language choice I need to exclude the
2007 Nov 04
3
Searching different fields based on document permissions
I''m currently writing a system that stores user-created documents. Each user belongs to a specific group, and the system supports multiple groups. The thing is, my users want to be able to hide pieces of a document from other groups. So for example, lets say Joe of team A has written this document: "Hello all, our secret plan is finally complete! <private>We will begin
2005 Dec 19
2
Parentheses for precedence?
I''m not sure whether this is a bug or whether I''m simply expecting Ferret queries to work in a way other than they''re intended. I notice that if use a query like: (other_text:"Collaborative tools") AND NOT other_text:podcasts I''ll get correct search results. However, if I put parentheses around the second part, like:
2007 Jan 17
7
removing special/syntax characters
Is there any somewhat standard way to remove or otherwise handle special or syntax characters from a user''s search, such as a colon? I was thinking maybe there was something akin to Ferret::Analysis::FULL_ENGLISH_STOP_WORDS, like Ferret::Analysis::FERRET_SYNTAX_CHARS, but no such luck. How are other folks dealing with filtering user input? John
2006 Sep 20
3
Range searches some times they work, some times not...
Hi i''m using ferret to enable geographical postcode. I take a postcode and distance in miles from the user, strip off the outcode and then retrieve the associated x y coordinates in metres from the db. Then i get two temp x''s and y''s and search for all results that are within the box, see code below. Problems start to occur when i search on big distances so for
2007 May 14
3
How to make a Tag cloud with Ferret ?
Hello, I want to make a TAG CLOUD using ferret. How can i do so ? I would need to know the amount of keyword for every each words in the index. Thank you -- Posted via http://www.ruby-forum.com/.
2007 Feb 15
3
Proximity searching in rdig ferret
Lucene has a syntax "foo bar"~10 for finding foo within 10 words of bar. Does ferret support this feature? (the ~ is used for fuzzy queries) Does rdig? This could be a deal breaker for me ''cos I really need proximity searches -- Posted via http://www.ruby-forum.com/.
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 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
2006 Sep 20
8
Understanding boost ?
Hi, I''m confused about managing field boosting ... I have set the :boost for the :name field in my docs to 10, via :boost => 10 Then I performed a search for ''keith'' over all fields via with *:(keith*), expecting a doc with Keith in the :name field to come out on top. But another doc with Keith mentioned in other fields (:comments, :address) scored higher. I