Solr-Get the name of the document the word is in

I use queries (Solr Admin) to search for words through two text documents that are in my HDFS. How can I get the name of the document the word is in. I am using this project https://github.com/lucidworks/hadoop-solr

I create a collection using bin/solr -e cloud , and I use "data_driven_schema_configs" from the server / solr / configsets / directory.

I tried adding <field name="fileName" type="string" indexed="true" stored="true" /> inside the managed scheme in ~ / solr-6.1.0 / server / solr / configsets / data_driven_schema_configs / conf, and also change its name to schema.xml, but there is not any dataConfig file in this directory to add <field column="file" name="fileName"/> , as I see it in some other posts with similar questions, but not for SolrCloud so I don’t know if I am trying correctly. What changes and in which directories should I make so that this can happen.

Example: I am looking for the word "largest", which can be found in both documents. As I can see in which document each result, sample1.txt or sample2.txt

enter image description here

+5
source share
1 answer

Same as I said when you mentioned this question in IRC:

Your Solr schema should contain the field in which you put this name, set the value "stored" = "true", and you must include this field with the corresponding value in each document when indexing. Most schema changes require a full reindex.

https://wiki.apache.org/solr/HowToReindex

+3
source

All Articles