Displaying 20 results from an estimated 1000 matches similar to: "Group By / Filters with UltraSphinx"
2008 May 27
0
Ultrasphinx geolookup distance returns NaN value.
Hi all,
I''m trying to use geo-location based search using sphinx, Here my search
query.
@search = Ultrasphinx::Search.new(:sort_mode => ''extended'', :sort_by =>
''distance'', :location => {:units => ''degrees'', :lat => 40.7414, :long =>
-74.0014})
@search.results.collect{|x| x.distance}
[0.69084495306015,
2009 Mar 06
1
Ultrasphinx search error... Invalid class name
I''ve got Ultrasphinx powering the search on my Rails app. It''s working
with all of my models when they''re first indexed, but then, after what
seems like a random amount of time, I''ll get the following error on
just *one* of my models:
search#show (Ultrasphinx::UsageError) "Invalid class name \"Playlist
\""
I set up this model like so:
2010 Dec 02
0
Thinking Sphinx sorting problem
Hello all,
I''m trying to get some records in my application to sort based on a SQL
calculated value and am getting no records returned. I have checked and
double checked and the query that TS is indexing is working out, but the
problem is with the controller.
Here is what I''m indexing:
----------------------------------------------------------
indexes
2008 Sep 16
0
Ultrasphinx, terminal not verbose anymore in development
Ultrasphinx''s great; one problem, if I start it, I don''t get anything in
the terminal when in developpment,
I might lack here of some setup knowledge, can''t find a good answer
googling, thanks if anybody has clues.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
2006 Jul 20
3
sort_by with via a parent models child
I am having a problem with ruby''s sort_by function. I want to sort a
list of parent model objects based on the children of the parent models.
Normally you might say sortedList = modelList.sort_by { |model|
model[''someAttribute''] }
What I am tring to do is
sortedList = modelList.sort_by{ |model| model.children.find(:first,
order=>"price desc" ).price}
2007 Sep 05
4
Mocking to spec a sort_by method
Hello,
I have a question regarding the use of Mocha with rSpec to spec one of
my methods.
My spec contains the following
vehical1 = mock()
vehical2 = mock()
vehical1.stubs(:mph).returns(150)
vehical2.stubs(:mph).returns(250)
comparer.add_vehical([@vehical1, @vehical2])
comparer.sort_by(:mph)
The comparer is an object that has a basic "stack like" functionality,
add_vehical is the
2006 Dec 04
10
Avoiding SQL Injection in :order?
This thread references:
http://www.ruby-forum.com/topic/90258#new
http://www.ruby-forum.com/topic/82349#143790
ActiveRecord''s find() method has built in ways to avoid SQL injection by
using the format
> :conditions => [ "user_name = ?", user_name]
Is there any such system for escaping injection in :order? It seems to
only take a string and feed it to the SQL
2018 Jan 18
0
Web scraping different levels of a website
I am web scraping a page at
http://catalog.ihsn.org/index.php/catalog#_r=&collection=&country=&dtype=&from=1890&page=1&ps=100&sid=&sk=&sort_by=nation&sort_order=&to=2017&topic=&view=s&vk=
From this url, I have built up a dataframe through the following code:
dflist <- map(.x = 1:417, .f = function(x) {
Sys.sleep(5)
url <-
2008 Jul 20
1
Installing plugins from .tar.gz file, how?
First, thanks for your attention!
I''m trying to install UltraSphinx plugin from svn but unfortunately it''s
down. I have a .tar.gz package, how can i install it?
./script/install package.tar.gz - doesn''t work
--
Regards,
Luiz Vitor Martinez Cardoso
cel.: (11) 8187-8662
blog: rubz.org
engineer student at maua.br
--~--~---------~--~----~------------~-------~--~----~
2006 Mar 23
2
Displaying only titles that starts with a defined caracter.
Hi,
I would like to know how to display only titles of products that starts
with a defined letter (ie: titles that begin with A)
Here is the method that I use to place all titles in alphabetical order:
class Livre < ActiveRecord::Base
validates_presence_of :titre;
def self.alpha
find( :all,
:order => "titre ASC"
)
end
end
2009 Jan 13
1
ROR - Excel Export Example
If you are running on Windows you can use create and read speadsheets
using the ''win32ole'' require
This sample should give you the basic idea
------
def export
require ''win32ole''
@sort_by = ''last_name''
current_user = ''steve''
@records = Contact.find(
:all,
:conditions =>
2006 Jan 10
1
sql server freetds/odbc question
I''m having an error from Linux via freeTDS/ODBC to SQL Server with
cod that runs fine against SQLite and MySQL. Here''s the code:
def find_recipes_for_workorder_by_id
@recipe_pages, @recipes = paginate_with_sort :recipes, :per_page
=> 10, \
:conditions => ["recipe.workorder_id = ?", params
[:workorder]]
render :template =>
2008 Mar 28
6
Eager Loading + Confusion
So I''m trying to do a find with an order by specific column values
thing, but some of the columns are attributes through associations.
So I did some eager loading with the :include option to try and access
the attributes of the object I''m doing the find on. Stuff has been
blowing up on me so far.
Here''s the code in the controller right now:
sort_by = params[:sort_by]
2006 Jan 10
1
sql server & linux: left join problem
I''ve got a left join problem of some sort connecting from linux
FreeTDS/ODBC to SQL Server. It''s similar to the false post I had
earlier, but this is a real problem. Here''s my code:
def find_recipes_for_workorder
@recipe_pages, @recipes = paginate_with_sort :recipes, :per_page
=> 10, \
:joins => ''left join workorder on
2010 Dec 01
0
Thinking sphinx + rails 3 issue in results set
Hi All,
I am using rails 3.0 and i installed sphinx and added the following to
gemfile gem ''thinking-sphinx'', ''2.0.0'', :require => ''thinking_sphinx''
My structure is like below:
==========================
Model:
=====
class User < ActiveRecord::Base
include ActionView::Helpers::UrlHelper
has_one :profile, :class_name =>
2006 Feb 19
2
progressive updates
I have a list view and have it sorting the data presented in the list
view by clicking on the top of the column - that works fine.
Now, I want to add a pop up-list which controls 3 different levels of
record select to be presented in this list...
- ALL
- placement.discharge_date IS NULL
- placement.discharge_date IS NOT NULL
I can have 3 different ''methods'' and
2007 Jun 22
1
exemple html - RSS
alex écrit:
Ce n''est pas possible d''afficher RSS/atom lui-même avec Wx::HtmlWindow.
Mais vous pouvez vous servir de quelques bibliothèques ruby pour
chercher RSS (par exemple ''net/http'', ''mechanize'', ''http-access2'') et
l''analyser (par exemple ''rexml'').
Donc, on devrait créer HTML qui répresente
2006 May 14
4
searching on foreing keys
Hey all,
I''m using a simple search function. It''s working
great except for foreign keys.
I have one table pets (id,name,owner_id)
and another table people(id,name)
owner_id being a foreign key of pet pointing to people name.
here it is on the pet controller:
@paginator, @pets= paginate(:pets, :conditions =>["name OR owner_id
like
2018 Jan 19
1
Web scraping different levels of a website
Hey Ilio,
I revisited the previous code i posted to you and fixed some things.
This should let you collect as many studies as you like, controlled by
the num_studies arg.
If you try the below url in your browser you can see that it returns a
"simpler" version of the link you posted. To get to this you need to
hit F12 to open Developer Tools --> go to Network tab and click on the
2008 Sep 27
0
Aspell crash
Hi
I recently extracted the spelling correction functionality from
Ultrasphinx and started to use it in Thinking Sphinx plugin.
Today I noticed that both thin instances on the server died and this is
what thin log says:
>> Thin web server (v0.8.2 codename Double Margarita)
>> Threaded mode OFF
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:7001, CTRL+C to