Note that there are some explanatory texts on larger screens.

plurals
  1. POSOLR - MYSQL - Query results
    primarykey
    data
    text
    <p>I'm working with SOLR and MySQL.</p> <p><strong>This is my data-config.xml</strong></p> <pre><code>&lt;dataConfig&gt; &lt;dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/meishidb" user="root" password="root"/&gt; &lt;document&gt; &lt;entity name="id" query="SELECT p.id, p.occ_name FROM BCARDS_OCCUPATION AS p"&gt; &lt;field column="id" name='id'/&gt; &lt;field column="occ_name" name='occ_name'/&gt; &lt;/entity&gt; &lt;/document&gt; &lt;/dataConfig&gt; </code></pre> <p><strong>These are the rows added to schema.xml</strong></p> <pre><code>&lt;field name="id" type="int" indexed="true" stored="true" required="true"/&gt; &lt;field name="occ_name" type="text" indexed="true" stored="true" required="true"/&gt; </code></pre> <p>The query works well, SOLR adds 'n' documents to the index. The problem is on querying the index; SOLR gives me results only if I type <code>'*:*'</code> and only about document ids (and not <code>occ_name</code>)!</p> <pre><code>&lt;response&gt; &lt;lst name="responseHeader"&gt; &lt;int name="status"&gt;0&lt;/int&gt; &lt;int name="QTime"&gt;1&lt;/int&gt; &lt;lst name="params"&gt; &lt;str name="indent"&gt;on&lt;/str&gt; &lt;str name="start"&gt;0&lt;/str&gt; &lt;str name="q"&gt;*:*&lt;/str&gt; &lt;str name="version"&gt;2.2&lt;/str&gt; &lt;str name="rows"&gt;10&lt;/str&gt; &lt;/lst&gt; &lt;/lst&gt; &lt;result name="response" numFound="5" start="0"&gt; &lt;doc&gt; &lt;str name="id"&gt;1&lt;/str&gt; &lt;/doc&gt; &lt;doc&gt; &lt;str name="id"&gt;2&lt;/str&gt; &lt;/doc&gt; &lt;doc&gt; &lt;str name="id"&gt;3&lt;/str&gt; &lt;/doc&gt; &lt;doc&gt; &lt;str name="id"&gt;4&lt;/str&gt; &lt;/doc&gt; &lt;doc&gt; &lt;str name="id"&gt;5&lt;/str&gt; &lt;/doc&gt; &lt;/result&gt; &lt;/response&gt; </code></pre> <p>If I search for:</p> <p><code>id:1</code> gives me the doc with id=1</p> <p><code>occ_name:1</code> gives me 'undefined field occ_name'</p> <p>why?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload