0

I have two cores in solr i.e. Core 1: BookID, Author, Year, Venue Core 2: BookID, Text, Reference

how can i merge these two cores in solr. I tried a lot for solution on the web but there is no straight forward solution. please can any one help.

Shah Khalid
  • 31
  • 1
  • 10
  • What do you mean merge them? Create a separate core that contains content from both, get a search result that includes results from both cores, import content form one of the cores into the other one, merge the documents to a single document based on BookID and index that? Or do you want to perform a join on query time and retrieve data from both cores? – MatsLindh Aug 10 '17 at 11:22
  • @MatsLindh thanks for reply, its ok i will use join for both the cores. but I want to store file name in id field, like file name is A001-2013 but the solr store in id /home/shah/solr/A001-2013 i.e. its store the whole path with name. can i store only the file name in id filed. – Shah Khalid Aug 11 '17 at 10:13
  • You can't join data from both sides of a join - that's why I was asking what you actually wanted to do. I'd remove the path in your display layer instead of when storing it in Solr, since it can be useful to identify the exact path for a file (or use copyField and copy the modified version to a separate field, either filtered by a suitable filter or through a regular expression filter) – MatsLindh Aug 11 '17 at 10:47
  • @MatsLindh , Basically I have about 20000 files, I want to store the name of these files in a separate field. how can i carry out that. like file name is A.txt, B.Txt. how can i store and index it in a field having name "FileName". also please check your email. Thanks for anticipated cooperation, – Shah Khalid Aug 11 '17 at 12:08
  • As mentioned, you can use a copyField instruction and a regular expression (see [PatternReplaceFilter](https://cwiki.apache.org/confluence/display/solr/Filter+Descriptions#FilterDescriptions-PatternReplaceFilter)) to remove anything before the last `/`. – MatsLindh Aug 11 '17 at 12:30
  • @MatsLindh it means there is no way to directly store and index file name in a specific field in solr. – Shah Khalid Aug 11 '17 at 12:49
  • You have the data you need, you have the configuration needed, and now you just need to configure Solr to do what you want it to do. You can't just think of something and assume that Solr will do it automagically. If you're indexing the data yourself and submitting it to Solr, you can just post the correct data in the first place, otherwise you'll have to configure your tool (which I guess might be the data import handler?) (Solr) to do what you want. – MatsLindh Aug 11 '17 at 13:09
  • @MatsLindh thanks for suggestions and giving time. the same questions is also discussed here(https://stackoverflow.com/questions/8390972/solr-return-file-name/8391006#8391006). But not clarified. My question is how to tell Post.jar to write file name to a specific field. Simply how to store and index file name in a specific field. is there any class that can extract and write name of a file to a specific field. Like i have added this to my schema.xml . Now how to index name of the file to this field. – Shah Khalid Aug 11 '17 at 13:33
  • solved Its very simple the solr FileListEntityProcessor provide the way to store and index the filename. – Shah Khalid Aug 12 '17 at 09:31

0 Answers0