[inne] Solr 7.7, dynamiczne nazwy indeksów |
[inne] Solr 7.7, dynamiczne nazwy indeksów |
30.08.2019, 12:09:23
Post
#1
|
|
Grupa: Zarejestrowani Postów: 325 Pomógł: 33 Dołączył: 31.05.2008 Ostrzeżenie: (0%) |
Cześć,
Rozpoczynam przygodę z solrem. Posiadam bazę z której zaciągam dane do solra za pomocą DataImportHandler. Struktura bazy wygląda następująco: Kod Product - id - name - description Kod ProductProperts - id - product_id - key - value Plik data-config.xml, która zaciąga mi dane z bazy Kod <dataConfig> <dataSource type="JdbcDataSource" name="product" driver="org.postgresql.Driver" url="jdbc:postgresql://127.0.0.1:5432/db_name" user="user" password="pass" /> <document name="products"> <entity name="product" query="SELECT id, name, description FROM product"> <field column="name" name="name" /> <field column="description" name="description" /> <entity name="properts" query="SELECT * FROM product_properts WHERE product_id='${product.id}'"> <field column="key" name="key_propert" /> <field column="value" name="value_propert" /> </entity> </entity> </document> </dataConfig> Plik manged-schema Kod <field name="id" type="string" multiValued="false" indexed="true" required="true" stored="true"/> <field name="name" type="string" multiValued="false" indexed="true" required="true" stored="true"/> <field name="description" type="text_general" multiValued="false" indexed="true" required="true" stored="true"/> <dynamicField name="*_propert" type="string" indexed="true" stored="true" /> Wynik z importu: W jaki sposób mogę zrobić, aby index "value_propert" uzależnić od wartości pola key_propert, tj. np.: length_propert: "75"? Ten post edytował kamil_lk 30.08.2019, 12:10:09 |
|
|
2.09.2019, 13:47:12
Post
#2
|
|
Grupa: Zarejestrowani Postów: 8 068 Pomógł: 1414 Dołączył: 26.10.2005 Ostrzeżenie: (0%) |
Możesz jaśniej jaki efekt chcesz uzyskać?
|
|
|
Wersja Lo-Fi | Aktualny czas: 19.04.2024 - 23:04 |