How can I use indexing on elastic search when there is no active record? but model.rb specify just like this
class Article
MIN_TERM_CHARS = 2
MAX_NGRAM_CHARS = 20
include SyncAttr
include Tire::Model::Persistence
index_name { Thread.current[:index_name] || "test" }
document_type "document"
# TODO: set index_options to doc for some fields for optimization
# TODO: maybe use simple analyzer for 'id' fieldsart
property :artikelnummer, type: 'string', index: 'not_analyzed'
property :eannummer, type: 'string', index: 'not_analyzed'
property :bezeichnung, type: 'multi_field', fields: {
bezeichnung: {type: 'string'},
ngram: {:type => 'string', :index_analyzer => 'ngram_index_analyzer', :search_analyzer => 'ngram_search_analyzer'},
suggest: {:type => 'string', :analyzer => 'suggest_analyzer'}
}
I want to index my data. How can I achieve this? I am using tire/karmi for this