Displaying 15 results from an estimated 15 matches for "post_tag".
2006 Jun 04
2
activerecord table help please
Hi everyone. I''m trying to figure out how to implement site-wide
tagging for my website. I have a rails-based weblog that supports
tagging posts. There''s a has_and_belongs_to_many relationship between
posts and tags. I''d like to now reuse those tags for tagging links as
well. Where I have a posts_tags table with post_id and tag_id fields,
I''d like to
2007 Sep 05
1
AAF and DRb with highlighting
...= index[hit]
result = {}
article = Article.find(doc[:id])
# Store each field in a hash which we can reference in our views
result[:headline_highlight] = index.highlight(query, hit,
:field => :headline,
:pre_tag => "<strong>",
:post_tag => "</strong>",
:num_excerpts => 1)
result[:body_highlight] = index.highlight(query, hit,
:field => :body,
:pre_tag => "<strong>",
:post_tag => "</strong>",
:num_excerpts => 1)
resu...
2007 Jun 19
3
another issue with highlighting
...sting
q="*1*"
z={}
index.search_each(q,:limit => :all) do |id,score|
for b in [:un, :deux, :trois, :quatre, :cinq, :six, :sept, :huit, :neuf, :dix]
z[b]=[] if not z[b]
z[b] << id.to_s + " : " + index.highlight(q,id,:field => b, :pre_tag => "<em>", :post_tag => "</em>", :num_excerpts => :all, :excerpt_length => :all).join(" | ") if index[id][b].match(/1/) and index.highlight(q,id,:field => b, :pre_tag => "<em>", :post_tag => "</em>", :num_excerpts => :all, :excerpt_length =&...
2007 Feb 16
1
Highlight raises Segmentation Fault Error in Ferret 0.10.9 i
...trying to use search highlight
feature on index_searcher
subject = index_searcher.highlight("subject:(blah blah)", 0,
:field => :content,
:pre_tag = "<span class=''highlight''>",
:post_tag = "</span>")
But all my tests fails and I run into Segmentation Fault Error.
Does anyone has come across this bug? I see couple of emails in this
forum but
I have not been able to find solutions. Can some one please help me and
tell me what is the correct implementation ?
-Amit
-...
2007 Feb 06
2
Which method to use to get content from index with a_a_f?
...lank? # normal case
@text = @myfile. # which method do I use here to get the :text from
the index???
else # if we come from the search results page
@text = @myfile.highlight(params[:search], { :field => :text,
:excerpt_length => :all, :pre_tag => ''[highlight]'', :post_tag =>
''[/highlight]'' })
end
end
I didn''t store my text in the database, only in the index. When I''m
coming from a search I use the highlight method, so the term I searched
for gets highlighted, but how do I get the text from the index in a
''normal cas...
2007 Jun 28
1
DRb server crashing
...s:16
----------- ferret_server.out -----------------
EMPTY
----------- ferret_server.log -----------------
call index method: highlight with [13, "Topic", "jesse",
{:field=>:ferret_name, :excerpt_length=>150, :num_excerpts=>1,
:pre_tag=>"<strong>", :post_tag=>"</strong>"}]
call index method: highlight with [13, "Topic", "jesse",
{:field=>:ferret_content, :excerpt_length=>150, :num_excerpts=>1,
:pre_tag=>"<strong>", :post_tag=>"</strong>"}]
call index method: highlight...
2007 Apr 13
5
undefined method `ferret_index'' for xxx:Class
Hi I am trying to use ferret; the regular search works; but when I use
the find_storage_by_contents to highlight the results, I am getting the
above error. Please help
thanks
--
Posted via http://www.ruby-forum.com/.
2007 Jun 07
3
:store => :yes doesn''t work in some cases
...es } }
I store both fields so that I don''t need to load each result model from
the rails DB when displaying the results. This is the code that I use to
show each result:
highlighted_name = result.highlight(params[:q], :field => :ferret_name,
:pre_tag => "<strong>", :post_tag => "</strong>", :excerpt_length =>
150, :num_excerpts => 1)
highlighted_content = result.highlight(params[:q], :field =>
:ferret_content, :pre_tag => "<strong>", :post_tag => "</strong>",
:excerpt_length => 150, :num_excerpts =&g...
2006 Jun 13
11
markaby
What''s the current status of Markaby? I''ve played with it a bit and
love it and am considering using it for a large project I''m starting.
If you''ve used it, I''d love to hear your comments!
Jamie
2007 Aug 08
0
Escaping special characters before highlighting
...n on the results of a ferret search
before it gets highlighted. Is there a way to do this?
This is my code which calls the highlighting inside a Rails View:
<%= result.ferret_highlight(@query, :field => :ferret_text, :pre_tag =>
''<span class="keyword">'', :post_tag => ''</span>'') %>
--
Posted via http://www.ruby-forum.com/.
2007 Jun 17
1
highlighting and range queries
...*'', Ferret::Search::RangeQuery.new(:test, :>= => "20070101") ]
index.search_each(q) do |id, score|
puts "Document #{index[id][:test]} found with a score of #{score}"
highlights = index.highlight(q, id, :field => :test, :pre_tag => "\033[36m", :post_tag => "\033[m")
puts highlights
end
puts "------"
end
--
2007 Feb 16
0
Highlight raises Segmentation Fault Error in Ferret 0.10.9 in Windows
...feature on index_searcher
subject = index_searcher.highlight("subject:(blah blah)", 0,
:field => :content,
:pre_tag = "<span class=''highlight''>",
:post_tag = "</span>")
But all my tests fails and I run into Segmentation Fault Error.
Does anyone has come across this bug? I see couple of emails in this forum but
I have not been able to find solutions. Can some one please help me and tell me what is the correct implementation ?
-Amit...
2007 Jan 25
0
multibyte character corrupt in highlight method
When I apply highlight() method to the search result,
multibyte characters are corrupted.
The post_tag is located in the middle of last character,
so the last character corrupts.
Here is my code.
query = "SOME_MULTIBYTE_CHARS"
searcher.search_each(query) do |doc_id, score|
puts searcher.highlight(query, doc_id, :field => :content)
end
And this is the result.
... bla, bla, bla, .....
2006 Dec 01
1
Effective search when knowing ID
...score|
puts "Document #{id} found with a score of #{score}"
highlights = index.highlight(content_query, id,
:field => :content,
:pre_tag => "\033[36m",
:post_tag => "\033[m",
:excerpt_length => 100)
puts highlights
end
Please comment of this!
Can I make my database PK id to be the ferret document ID??
Would that speed it up?
Cheers,
Henrik
2008 Sep 19
1
Help with best approach(fairly easy question)
...params[:user]
@posts = Posts.find(:all, :conditions => ["user_id = ?,
params[:user_id]])
elsif params[:tag]
.
.
.
end
2) Should I create different controllers with only an index action on
it (Create and other actions stay on the posts_controller):
post_categories controller? post_tags controller? user_posts
controller?
So, which approach should I use?
Thanks again,
Elioncho
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to...