Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [inne] Solr 7.7, dynamiczne nazwy indeksów
kamil_lk
post 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
Go to the top of the page
+Quote Post
Pyton_000
post 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ć?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 19.04.2024 - 23:04