Hi Arun

Firstly - mem_limit is just for indexing, not for searching.

I'm not sure if Sphinx has some way of querying the query length limit, but perhaps it's worth searching the Sphinx docs or asking on the Sphinx forum?

That said - if you're writing queries across that many values, I'm not sure if Sphinx is the best fit? Why do you need to query across 500 (or even 50) zip codes? Is there some way to simplify the query? Search by state?

Cheers

--
Pat

On 11/09/2010, at 12:14 AM, Arun <[email protected]> wrote:

Hi pat,
I got serious issue in my application,
sample code:
zip_code= zipcodes.collect(&:zipcode).try(:join,"|")
@donates= Donate.search params[:search],:conditions => {:zip =>
"#{zip_code}"}

In zip_code ,i am getting more than 500 zip codes , i am getting 0
records .If i given less 200 records it is working fine wat to do ?

Even in the sphnix.yml,i given mem_limit=128M but no use

On Sep 10, 6:05 pm, Arun Prakash <[email protected]> wrote:
Hi Pat,
Its working fine but again one problem,
:conditions => {:zip => "(01234 | 56789)"} "

In this i have more than 500 zip codes.If i passed whole thing in side
the condition result is 0 but if i passed the less number of zip
codes inside the condition it is working fine.Whether i need to mem limit in
spinix.yml file .Any suggestions?

Best Regards
 Arun Prakash C.K

Keep On Sharing Your Knowledge with Others







On Fri, Sep 10, 2010 at 4:45 PM, Pat Allan <p...@freelancing- gods.com> wrote:
This is because :with_all is for filters, which only apply to attributes. Currently you have zip as a field - which is probably the best option, as
you can't currently filter by string attributes.

--
Pat

On 10/09/2010, at 7:11 PM, Arun <[email protected]> wrote:

 Hi pat ,
Now its  working fine but one doubt , can i use with_all filters
instead of" :conditions => {:zip => "(01234 | 56789)"} " because i am
getting the condtion like value like this
z= [92656, 92698, 92801, 92802, 92803, 92804, 92805]

@donates = Donate.search params[:search],:with_all => {:zip =>z}

so result should come related to this code only but it is not working
for me ??

Any sugesstion ?

On Sep 10, 3:54 pm, Pat Allan <[email protected]> wrote:

Sphinx can only query against the information it knows about - ie:
what's in the index.

So, if you want to query against zip codes, make sure you have a field
for that column:

  indexes zip

Keep in mind that string attributes can't be used for filters:
http://freelancing-god.github.com/ts/en/common_issues.html#string_fil ...

If you want to query by multiple zip codes, then check out the sphinx docs for the extended match mode syntax - you'll want to wrap all zip
codes together with parentheses, and separate them with OR pipes:

  Donate.search :conditions => {:zip => "(01234 | 56789)"}

Cheers

--
Pat

On 10/09/2010, at 6:37 PM, Arun <[email protected]> wrote:

 Hi Pat,

 In the donate model block is
define_index do
   indexes title
 end

 On Sep 10, 3:34 pm, Pat Allan <[email protected]> wrote:

Hi Arun

 What does the define_index block in your Donate model look like?

 -- Pat

 On 10/09/2010, at 6:32 PM, Arun <[email protected]> wrote:

thanks i have installed 2.0.0.rc2 and in the filters i am using the
array only.

 Even though i perforemd search like this
donate = Donate.search "Stringer", :conditions => {:zip =>91795} Stringer word is matched with zipcode but result is not retrieving
and
also i regenerated the index and i restarted  the servers also
what to
do ?

 On Sep 10, 3:16 pm, Pat Allan <[email protected]> wrote:

Hi Arun

What does your define_block look like?Because you can't use string
attributes for filters.

Also, probably best using 2.0.0.rc2 - though that shouldn't change
anything in this situation.

 Cheers

 --
Pat

 On 10/09/2010, at 6:12 PM, Arun <[email protected]> wrote:

 Hi friend,
I have installed the "gem 'thinking-sphinx', '2.0.0.rc1', :require
=>
'thinking_sphinx'" in the rails 3 application

 Search function is working but Attribute Filters,field condtions
is
not working

 I need to search donation  name with matched zipcodes only ,so i
used
like this
@donates = Donate.search params[:search],:with_all => {:zip =>
zipcodes.collect(&:zipcode)}

 But it is retrieving the result even it not matching also and i
tried
like this in console to check sphinx

 Donate.search "Stringer", :conditions => {:zip => '91795'}
zip code belongs to "stringer" but it is also not retrieving

 where i am doing wrong??

 --
You received this message because you are subscribed to the Google
Groups "Thinking Sphinx" group.
To post to this group, send email to
[email protected]
.
To unsubscribe from this group, send email to
[email protected]<thinking-sphinx %2Bunsubscribe@ googlegroups.com>
.
For more options, visit this group athttp:// groups.google.com/
group/thinking-sphinx?hl=en
.

 --
You received this message because you are subscribed to the Google
Groups "Thinking Sphinx" group.
To post to this group, send email to [email protected]
.
To unsubscribe from this group, send email to
[email protected]<thinking-sphinx %2Bunsubscribe@ googlegroups.com>
.
For more options, visit this group athttp://groups.google.com/
group/thinking-sphinx?hl=en
.

 --
You received this message because you are subscribed to the Google
Groups "Thinking Sphinx" group.
To post to this group, send email to [email protected] .
To unsubscribe from this group, send email to
[email protected]<thinking-sphinx %2Bunsubscribe@ googlegroups.com>
.
For more options, visit this group athttp://
groups.google.com/group/thinking-sphinx?hl=en
.

--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected] .
To unsubscribe from this group, send email to
[email protected]<thinking-sphinx %2Bunsubscribe@ googlegroups.com>
.
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.

--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected] .
To unsubscribe from this group, send email to
[email protected]<thinking-sphinx %2Bunsubscribe@ googlegroups.com>
.
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.

--
You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected] . For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en .


--
You received this message because you are subscribed to the Google Groups "Thinking 
Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to