Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- solrconfig.xml -->
- <?xml version="1.0" encoding="UTF-8" ?>
- <config>
- <luceneMatchVersion>6.6.0</luceneMatchVersion>
- <lib dir="/Users/lucaswxp/solr-6.6.0/lib/" regex="mongodb-driver-.*\.jar" />
- <lib dir="/Users/lucaswxp/solr-6.6.0/lib/" regex="solr-dataimporthandler-.*\.jar" />
- <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
- <lst name="defaults">
- <str name="config">data-config.xml</str>
- </lst>
- </requestHandler>
- </config>
- <!-- schema.xml -->
- <?xml version="1.0" encoding="UTF-8" ?>
- <schema version="1.5">
- <fields>
- <field name="_id" type="string" indexed="true" stored="true" required="true"/>
- <field name="title" type="string" indexed="true" stored="true" required="true"/>
- </fields>
- <uniqueKey>_id</uniqueKey>
- <types>
- <fieldType name="string" class="solr.StrField" />
- </types>
- </schema>
- <!-- data-config.xml -->
- <?xml version="1.0"?>
- <dataConfig>
- <dataSource name="MyMongo" type="MongoDataSource" database="reduza" />
- <document name="import">
- <!-- if query="" then it imports everything -->
- <entity processor="MongoEntityProcessor"
- query="{}"
- collection="products"
- datasource="MyMongo"
- transformer="MongoMapperTransformer" name="product">
- <!-- If mongoField name and the field declared in schema.xml are same than no need to declare below.
- If not same than you have to refer the mongoField to field in schema.xml
- ( Ex: mongoField="EmpNumber" to name="EmployeeNumber").
- <field column="_id" name="id"/>
- <field column="EmpNumber" name="EmployeeNumber" mongoField="EmpNumber"/>
- -->
- </entity>
- </document>
- </dataConfig>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement