Skip to content

Commit

Permalink
Documentation for field names
Browse files Browse the repository at this point in the history
  • Loading branch information
helix84 authored and ctenar committed Nov 12, 2013
1 parent d349317 commit b837216
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/queryingsolr.rst
Expand Up @@ -120,6 +120,25 @@ queries into the same ``query()`` call, but in a more complex environment,
it can be useful to partially construct a query in one part of your program,
then modify it later on in a separate part.

Field names
-----------

To look at the list of available fields in the Solr schema, look at the ``si.schema.fields`` property:

::

>>> print si.schema.fields.keys()
['id', 'cat', 'name', 'price', 'author_t', 'series_t', 'sequence_i', 'genre_s']

.. note:: If your field names contain undescores dots (.), you won't be able to use
them as parameter names in the query() method. Luckily, Python offers here something
called "keyword argument application from a dictionary", so you can specify
your field name - value pairs in a dictionary as follows:

::

si.query({'name': "game", 'author_t': "Martin"})


Executing queries and interpreting the response
-----------------------------------------------
Expand Down

0 comments on commit b837216

Please sign in to comment.