You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried following the tutorial at http://haystacksearch.org/docs/tutorial.html#haystack-tutorial, but I ended up with the following problem:
even if I have
import haystack
haystack.autodiscover()
in urls.py, build_solr_schema generates the same output as if no SearchIndex was defined. Using this schema, solr understandably gives
SEVERE: org.apache.solr.common.SolrException: no field name specified in query and no defaultSearchField defined in schema.xml
(I'll try to attach or link to a minimal example that shows this problem.)
The text was updated successfully, but these errors were encountered:
I believe SHA: 95d40e4 fixes your issue. When I modify (the haystack portion) of your urls.py to be:
from trivial.models import Thing
from haystack import site
site.register(Thing)
I get the correct schema. I also get the correct schema by using:
from trivial.models import Thing
from haystack import site
from haystack import indexes
class ThingIndex(indexes.SearchIndex):
name = indexes.CharField(document=True, model_attr='name')
site.register(Thing, ThingIndex)
The odd one out here is the autodiscover but that won't work unless you create a search_indexes.py file within your app where you register the SearchIndex classes. (This is analogous to the way django.contrib.admin does autodiscover, the only method I was using/testing and was working regardless).
Somewhere along the line, an odd regression came up and caused the erroneous behavior. It should be fixed now for all cases and I have tests to make sure it stays that way.
I tried following the tutorial at http://haystacksearch.org/docs/tutorial.html#haystack-tutorial, but I ended up with the following problem:
even if I have
import haystack
haystack.autodiscover()
in urls.py, build_solr_schema generates the same output as if no SearchIndex was defined. Using this schema, solr understandably gives
(I'll try to attach or link to a minimal example that shows this problem.)
The text was updated successfully, but these errors were encountered: