la-haute-societe / craft-elasticsearch

Bring the power of Elasticsearch to your Craft CMS projects
Other
18 stars 14 forks source link

How can we add custom field while indexing entries? #2

Closed ankitchauhan22 closed 5 years ago

ankitchauhan22 commented 5 years ago

Hi,

First of All, thank you for the plugin.

This has reduced our work upto 90%. Now I want to index some custom field associated to entry. Is there a way to append or customize the schema which is being used while indexing entries? Please suggest.

Regards Ankit

juban commented 5 years ago

Hi @ankitchauhan22

Thank you for your kind words. For now, there is no easy way to do what you want as the plugin is mainly indexing entry page content. So, the only way I can figure out right now would be to add some "hidden" text info (meta info, hidden div...) and output the content into your template so that its content can be indexed. To be able to customized the elasticsearch schema is definitely something we will implement in future release.

I'll let you know as soon as we'll be able to work on that.

Thanks.

ankitchauhan22 commented 5 years ago

Alright.

Now I'm using plugin elasticraft which is fuillfilling our purpose of indexing customize schema with the help of transformers.

For searching, we need to do some work around.

Regards Ankit Chauhan

juban commented 5 years ago

Well, we didn’t know about that plugin. Looks pretty good, so totally understand if it suits you better. We will try to make ours better, so stay tuned 😉 Thank you again for your feedback.

juban commented 5 years ago

Hi @ankitchauhan22,

We just released 1.1.0-beta.1 version with support for customized schema and additional fields. If you get a chance to test it, that would be great to know if it suits your needs. Feel free to tell us if you have any questions or issues with it.

Thank you for you feedback.

Regards.

juban commented 5 years ago

1.1.0 release includes a full set of features allowing to easily add additional fields in the Elasticsearch index.