Here's the line I added:
define_index do
[... Stuff ...]
set_property :min_prefix_len => 1
end
And then I run:
rake ts:config
rake ts:in
rake ts:run
And nothing new. I keep checking the config file, and it never changes
due to this. I even manually go in and change the file, and then in is
replaced with a file without anything relating to min_prefix. Any
thoughts?
-----
As an aside, what version of thinking sphinx now allows multiple
indexes against a single table? I'd like to have one index with
min_prefix_len on, and one without.
What version of TS are you currently using? 1.3.6 was when multiple index support was added, but I'd recommend using the latest (1.3.14). Also, what's the full contents of your define_index block?
--
Pat
> --
>
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
>
>
In truth, I'm not sure - the gemspec says 0.9.9, but rake ts:version
fails (Don't know how to build task 'thinking_sphinx:version').
The rest of my define index is very standard:
define_index do
#indexed fields, fields to be added to the full text index
indexes :name, :sortable => true
indexes aliases(:alias), :as => :aliases
#attributes (fields to be sorted by, or grouped by)
has [field names], :as => [aliases] x 20
set_property :min_prefix_len => 1
#used to determine if the index has been rebuilt recently
has "UNIX_TIMESTAMP()", :as => :index_time
end
If there's no ts:version task, then I think you're using a really old version of TS. It's definitely worth trying to upgrade, see if that helps matters.
--
Pat
ERROR: section 'library_core_0' (type='source') already exists [...]
The multiple index support isn't really documented at all... but what you'll need to do is give any additional indexes an explicit name, to avoid collisions:
define_index do
# default
end
define_index 'prefixed_library' do
# additional
end
Hopefully this gets it working.
--
Pat
Library.search('New York')
Library.search('Ne', :index => 'prefixed_libray')
?
If you want to query across two indexes, just do a standard search:
Library.search 'New York'
The :index option will filter on a specific index (multiple ones can be defined in a string, comma-separated).
However, you cannot direct part of a query at a specific index (ie: New York on your core index, Ne on the prefixed one), all at once. The two queries you've specified below should work, though, if you're doing them separately. The only catch is that you may need enable_star set to true and then for the second, use stars/wildcards:
Library.search 'Ne*', :index => 'prefixed_library'
I've not done any thorough testing on whether wildcards are needed to force the prefix/infix matching. Hopefully it's not required, but I've vague memories of it not working for some people.
Hope this is helpful.
--
Pat
-Upgrade to more recent version of TS - older versions (<1.3.14) do
not support multiple indexes
-The define index blocks need to be setup like this:
define_index 'library_index' do
[...]
end
define_index 'prefix_library_index' do
[...]
set_property :min_prefix_len => 1
end
-Calling the search function needs to specify the index or it will
search across all indexes -
Library.search(keyword, { index => 'prefix_libary_index', <other
params here> } )
On Jan 1, 9:54 pm, Pat Allan <p...@freelancing-gods.com> wrote:
> Hi David
>
> > For more options, visit this group athttp://groups.google.com/group/thinking-sphinx?hl=en.- Hide quoted text -
>
> - Show quoted text -