Site Search
-----------

This tests the Solr-based replacement for Plone's site search feature.  We'll
use a testbrowser to created an object and then search for it.  First we need
to activate Solr support and reindex the site's content, though:

  >>> self.activateAndReindex()

  >>> self.setRoles(('Manager',))
  >>> browser = self.getBrowser()
  >>> browser.open('http://nohost/plone/')
  >>> browser.getLink('Page').click()
  >>> browser.getControl('Title').value = 'Foo'
  >>> browser.getControl('Save').click()
  >>> browser.url
  'http://nohost/plone/foo'
  >>> browser.contents
  '...Info...Changes saved...
   ...documentFirstHeading...Foo...'

  >>> browser.getControl('Search Site').value = 'Foo'
  >>> browser.getForm(name='searchform').submit()
  >>> browser.contents
  '...Search results...1...items matching your search terms...
   ...http://nohost/plone/foo...Foo...'
  >>> browser.getLink('Foo')
  <Link text='Foo' url='http://nohost/plone/foo'>

Some content items, for example files and image, don't have an associated
workflow state.  Hence they cannot provide data for a `review_state` index
as well.  However, Plone's search results listing template (`search.pt`)
contains the string expression "state-${result/review_state}", and the TAL
engine will attempt to traverse `result` in case dictionary and attribute
lookups for `review_state` weren't successful.  Let's make sure this
behaviour won't break things:

  >>> portal.invokeFactory('File', id='file', title='my first file')
  'file'
  >>> browser.open('http://nohost/plone/')
  >>> browser.getControl('Search Site').value = 'my first file'
  >>> browser.getForm(name='searchform').submit()
  >>> browser.contents
  '...Search results...1...items matching your search terms...
   ...http://nohost/plone/file...my first file...'


Wildcard searches
-----------------

Simple searches should be wildcard searches to reflect (and not change)
Plone's default behaviour.  So at least for single words the search should
be automatically adjusted:

  >>> browser.open('http://nohost/plone/')
  >>> browser.getControl('Search Site').value = 'Fo'
  >>> browser.getForm(name='searchform').submit()
  >>> browser.contents
  '...Search results...2...items matching your search terms...
   ...http://nohost/plone/foo...Foo...'
  >>> browser.getLink('Foo')
  <Link text='Foo' url='http://nohost/plone/foo'>
