5

I've gone over this: https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-api#usage

The given example for creating an index is`

client.index  index: 'myindex', type: 'mytype', id: 1, body: { title: 'Test' }

I've looked everywhere and can't seem to find any descriptions of the parameters, ie. index, type, id, body. I'm just not sure what type of information is supposed to be represented there. I'm guessing index: is the name you're giving to the index, but the rest I can't get a lead on. Also, I'm unsure of how you would normally implement these index's into a rails app, ie. what type of files are they normally put into.

Thanks in advance for any help!

2

2 Answers 2

3

In case you are usign ROR,

You can create index on a particular model by running on rails console - CTRL+C

MODEL_NAME.import force: true

Sign up to request clarification or add additional context in comments.

Comments

2

The documentation at http://rubydoc.info/gems/elasticsearch-api/Elasticsearch/API/Actions#index-instance_method lists all the parameters and has examples.

For Rails integration, have a look at the elasticsearch-model gem. It allows you to integrate Elasticsearch with your Rails models.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.