Displaying 20 results from an estimated 1000 matches similar to: "Query Objects vs. Query Strings"
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(
2006 Jul 09
3
acts_as_ferret.. what does it actually do?
Okay in this plea for help I''m going to repeat some of what i posted
before but with a larger amount of background info in the hope that i
can get a decent grip on ferret before it wriggles away..
Firstly, what does installing the acts_as_ferret plugin actually do? I
install it and add it to my model and then the index is automatically
generated and a few methods are added to it and
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
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 *
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/.
2006 Sep 05
4
No matches
The following script creates a search index and then searches it. I get
no results? Where am I going wrong?
Thanks.
-----------BEGIN SCRIPT----------------
require ''rubygems''
require ''ferret''
include Ferret
path = ''/tmp/myindex''
field_infos = Ferret::Index::FieldInfos.new()
field_infos.add_field(:name, :store => :yes, :index => :yes)
2007 Mar 21
4
Cannot delete for id of type Array
Hello list,
I have a little weird error when deleting documents from the index.
I''m using the following code.
ferret_index = Ferret::Index::Index.new(:path => FERRET_INDEX_PATH)
query = Ferret::Search::TermQuery.new(:fk_file_id, "#{_fk_file_id}")
ferret_index.search_each(query) do | id |
ferret_index.delete(id)
end
And I get the following error
Cannot delete for id of
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.
2005 Dec 14
2
undefined method `add'' for Ferret::Search::BooleanQuery
Up to now in my ferret development I have been using simple
single-word strings as my search queries. I just now am trying to
increase the complexity of my queries. When I was passing a single
word with no spaces in my index searches, like so:
count = index.search_each(''testing'') do |d, s|
...
end
everything worked fine. But now when I do something like this:
count =
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
2007 Feb 01
2
Searcher do not work or I do not work
Hi.
I want to learn more about ferret. So I downloaded ferret-0.10.14 and
write a simple test script
Only query = TermQuery.new(:content, ''program'') gives result.
If I change ''program'' with ''Good'' or ''Extra'' -> no result
and searching on (:title, ''Ruby'') -> no result
Strange, Strange
Here is the
2006 Aug 04
1
incorrect checksum for freed object?
I''m using ferret (0.9.4) in rails, but outside of the "acts_as_ferret"
plugin. Whenever I use a QueryFilter (even a very simple one), the server
will crash after one, two, or three reloads of a page (same page, same
query, same filter). It''s very non-deterministic and I can''t seem to
reproduce it outside of my application environment (I can''t get it
2007 Jan 05
3
Confused about Search Results
Hi everyone,
I''m pretty new to Lucene and Ferret, so I feel that this is most likely
myself not completely understanding the correct way to do this. I haved
indexed ~2200 text files (of various sizes), and I am now running
searches on the index to get a feel for Lucene and Ferret.
In my first program, which is using Lucene I search for ''influenza'' and
get the
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 Jan 29
1
Segmentation fault in Search::Searcher#highlight
I''m using ferret 0.10.14 in Linux Fedora 3.
When I do highlight with Index::Index#highlight, it works well.
But, doing the same test with Searcher#highlight,
[BUG] Segmentation fault occurred.
Here''s my test code.
require ''rubygems''
require ''ferret''
include Ferret::Search
#searcher = Ferret::Index::Index.new(:path =>
2006 Jul 15
2
FieldQuery not returning anything
Hey ..
The QueryParser RDoc page explains to me on how to search for a specific
value in a specific field. This is not working the way i thought it
should be, what am i doing wrong? Here''s an example ..
I''m storing model data in the index like this:
doc << Field.new( "object_id", object.id, Field::Store::YES)
doc << Field.new( "type",
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 Sep 22
2
Searching untokenized fields
Hi ..
I tried to exclude certain objects from my search, by adding appropriate
term queries ..
i = Ferret::Index::Index.new
i.field_infos.add_field(:type, :index => :untokenized, :term_vector => :no)
i << {:type => "Movie", :name => "Indiana" }
i << {:type => "Movie", :name => "Forrest" }
i << {:type =>
2019 Mar 08
0
imap segfault in libc.so with CLucene FTS backend enabled
Steps to reproduce:
- Enable CLucene FTS in Dovecot;
- Open mailbox with MUA;
- Search for message with any text;
- IMAP session crash.
OS: Gentoo Base System release 2.6
Version:
FTS: dev-cpp/clucene-2.3.3.4-r6
IMAP: net-mail/dovecot-2.3.2.1
LIBC: sys-libs/musl-1.1.21
Dovecot FTS config:
plugin {
fts = lucene
fts_lucene = whitespace_chars=@. normalize no_snowball
fts_autoindex=yes
2005 Dec 14
5
Query question
I have an index in which I want different records to be accessible to
different users. I think I can do this by adding a "users" field to
each record in the index and narrow down my queries to only those
records matching the current user''s userid. I have the userids
separated by commas. What would be the right way to query for a
certain user? I have to make sure that I