Home Ask Login Register

Developers Planet

Your answer is one click away!

Shafiq February 2016

How to index and serve poems using apache solr

I am using solr 4.10. I have to index poetry data in solr. Now what should be the document structure. Basically, I want to give a search facility for a term in poem. Only that specific distich should be given back. Now should I index complete poem in single document or one document per distich. I know some poems have two lines for single concept and some 4 etc. Now What should be its storing format ?


MatsLindh February 2016

Index the distiches individually and link them through a poem identifier and a sequence id. That way you can also retrieve the distich before or after - or the whole poem.

If there's certain use cases that need to treat the poems as a whole instead, create a separate collection and index to both collections. That way you can adjust and tweak the search results as you need, depending on the use case.

Post Status

Asked in February 2016
Viewed 2,013 times
Voted 5
Answered 1 times


Leave an answer

Quote of the day: live life