dunno~ even preexisted data in mysql can't be indexed~
i found the auto generated sphinx config is nothing different from
attachment (◕‿‿◕。)
but sphinx query always returns nothing~
*indexer*
*{*
*}*
*searchd*
*{*
* listen = 127.0.0.1:9312:mysql41*
* log = /home/frank/Dropbox/proects/testing/log/development.searchd.log*
* query_log =
/home/frank/Dropbox/proects/testing/log/development.searchd.query.log*
* pid_file =
/home/frank/Dropbox/proects/testing/log/development.sphinx.pid*
* workers = threads*
* binlog_path = /var/log*
*}*
*index conversation_tenant1_core*
*{*
* type = rt*
* path =
/home/frank/Dropbox/proects/testing/db/sphinx/development/conversation_hp_core*
* docinfo = extern*
* charset_type = utf-8*
* charset_table = 0..9, U+27, etc*
* min_prefix_len = 1*
* enable_star = 1*
* ngram_len = 1*
* ngram_chars = U+3400..U+4DB5,etc*
* rt_field = sphinx_internal_class_name*
* rt_field = post_content*
* rt_field = topic_name*
* rt_field = title*
* rt_attr_uint = sphinx_deleted*
* rt_attr_bigint = sphinx_internal_id*
* rt_attr_string = sphinx_internal_class*
* rt_attr_string = network_id*
* rt_attr_string = created_at*
* rt_attr_string = updated_at*
* rt_attr_string = user_id*
* rt_attr_string = current_user_id*
* rt_attr_string = group_id*
*}*
*... and so on ...*
Pat Allan於 2015年5月12日星期二 UTC+8下午4時26分14秒寫道:
>
> Have you got callbacks in the models you’re indexing, to ensure the data
> is being saved to Sphinx?
>
> And have you run `rake ts:regenerate` to get all the indices set up and
> existing records indexed?
>
> —
> Pat
>
> On 12 May 2015, at 6:01 pm, Frank H <[email protected] <javascript:>>
> wrote:
>
> excuse me~
> i figured out select from index name is formal~
> it's Sphinx Query not MySQL query xD
> but now here comes another issue~
> i found that i'm indexing nothing~ always 0 result~~
>
> Frank H於 2015年5月11日星期一 UTC+8下午7時49分44秒寫道:
>>
>> dear Pat&All how can i define a index whose name is different from it's
>> table name by real_time~ appreciate~ ◑ω◐
>> i've worked hard to approach this:
>>
>> http://www.rubydoc.info/github/pat/thinking-sphinx/ThinkingSphinx/Index#define-class_method
>> i'm using the apartment to do the multitenancy~ my code is as following~
>> sorry for disturbing~ have a good one~ d(-_^)
>>
>> current_tenant = Apartment::Tenant.current
>>
>> *# Each Tenant instance is tied to a tenant in this example.*
>>
>> Tenant.find_each *do* |tenant|
>>
>> *# Switch to the appropriate Apartment tenant.*
>>
>> Apartment::Tenant.switch tenant.db
>>
>>
>> ThinkingSphinx::Index.define(
>>
>> *:topic*,
>>
>> *# with: :active_record,*
>>
>> *# delta: true,*
>>
>> *name*: "topic_*#{*tenant.db*}*",
>>
>> *table_name: "topic",(wanted) *
>>
>> *offset_as*: "topic_*#{*tenant.db*}*".to_sym,
>>
>> *with*: *:real_time* )*do*
>>
>>
>> *# fields*
>>
>> indexes name, *sortable*: *true*
>>
>>
>> *# attributes*
>>
>> has network_id,created_at, updated_at, *:type* => *:string*
>>
>>
>> *# For real-time indices, let's make sure we're using the
>> appropriate tenant.*
>>
>> scope { Apartment::Tenant.switch tenant.db; Topic }
>>
>> *end*
>>
>> *end* *if* Tenant.table_exists?
>>
>>
>> *# Switching back to the original tenant - this is useful in the
>> development*
>>
>> *# environment, as indices (and thus, this file) can be reloaded, and we
>> don't*
>>
>> *# want to always leave our app on our last tenant.*
>>
>> Apartment::Tenant.switch current_tenant
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected]
> <javascript:>.
> Visit this group at http://groups.google.com/group/thinking-sphinx.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.