.. _makingqueries:

Making Queries
==============

Connecting to Solr
------------------

To connect to Solr you need to create an instance of ``IcarusInterface`` and provide a ``host``, ``core`` and ``port``.

For example, to connect to the ``test`` core on ``localhost:8983``:

::

 from icarus.interface import IcarusInterface

 ii = IcarusInterface('localhost', 8983, 'test')

The Simplest Query
------------------

To select all documents, you can instantiate and execute a basic query

::

 from icarus.query.query_classes import SearchQuery

 q = SearchQuery(ii)
 result = q.execute(0)
 myitems = result.items

