mysql - Solr query doesn't show all the fields -
i learning solr (5.5.0) , running in standalone mode.
here solr-data-config.xml:
<dataconfig> <datasource type="jdbcdatasource" driver="com.mysql.jdbc.driver" url="jdbc:mysql://127.0.0.1/dbn" user="root" password="root"/> <document> <entity name="planexample" query="select * plan userid=60 limit 3"> <field column="planid" name="id" /> <field column="userid" name="userid" /> <field column="planname" name="planname" /> <field column="del" name="del" /> </entity> </document> </dataconfig>
and add fields accordingly managed-schema:
<field name="userid" type="int" indexed="true" stored="true" required="true" multivalued="true"/> <field name="planname" type="string" indexed="true" stored="true" required="true" multivalued="true"/> <field name="del" type="int" indexed="true" stored="true" required="true" multivalued="true"/> <field name="id" type="string" indexed="true" stored="true" required="true" multivalued="false" />
but when query on webpage of solr, example, ip:8983/solr/corename/select?q=del%3a1&wt=json&indent=true
or ip:8983/solr/corename/select?q=userid%3a60&wt=json&indent=true
, results show id
except userid,planname,del
, how make fields visible in results? , score
field mean in results?
one example of results:
{ "responseheader": { "status": 0, "qtime": 1, "params": { "indent": "true", "q": "del:1", "_": "1461050814466", "wt": "json" } }, "response": { "numfound": 10, "start": 0, "maxscore": 0.90468985, "docs": [ { "id": "985963", "score": 0.90468985 }, { "id": "1033572", "score": 0.90468985 }, { "id": "1763216", "score": 0.90468985 } ] } }
you need provide fl
parameter, stored fields, &fl=*
, or comma seperated list of fields want i.e. &fl=id,userid,planname,del
example.
Comments
Post a Comment