Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSolr::Error::Http - 400 Bad Request Error: ERROR:unknown field 'tags_ac' #1

Open
MazenAly opened this issue Sep 10, 2012 · 4 comments

Comments

@MazenAly
Copy link

Hello everyone !!
i did what's written :
but when i try to reindex.. i have this error :
rake aborted!
RSolr::Error::Http - 400 Bad Request
Error: ERROR:unknown field 'tags_ac'

as the model that searchable called Experience and i put this block in it

searchable do
text :tags, :boost => 3
text :title, :boost => 2
text :tips
autocomplete :tags, :using => :tags
end
what's the problem guys ? Thanks a lot :)

@xponrails
Copy link
Owner

I think the problem should be in the declaration
autocomplete :tags, :using => :tags

that should be changed in this way:
autocomplete :classname_tags, :using => :tags

for example, the configuration for my Account class is:

class Account
  include Sunspot::Mongoid
  searchable do
    autocomplete :account_username, :using => :username

    text :username
    text :first_name
    text :last_name
  end
end

@MazenAly
Copy link
Author

yes it worked now Thanks a lot .. but i have another problem ..in the last step i put in the view file

<%= autocomplete_text_field "experience", "tags", "http://127.0.0.1:8983/solr/", "experience_tags"%>

it appears in the browser like this :

<script>$('#experience_tags').autocomplete('http://127.0.0.1:8983/solr/', 'experience_tags', {});</script>
and not a text box !!

i want the autocomplete text box and also i want to put it in a form which will pass the query to the controller ..
just like this :

<%= form_tag experiences_path, :method => :get do %>

<%= text_field_tag :search, params[:search] %> // the autocomplete box should replace this

<%= submit_tag "Search", :name => nil %>

<% end %>

Thanks a lot man for your help :)

@xponrails
Copy link
Owner

Hi.

I think you are missin the raw helper.

<%= raw autocomplete_text_field 

@redbar0n
Copy link

TL;DR: Solr seems to crash because of some corrupt contents in the solr/data folder. So delete it, stop solr, start it again, and reindex to create the solr/data folder again.

What worked for me was deleting the solr/ folder, and then starting solr again so that it would generate that folder again. I then replaced the solr/conf folder with my backed up version. Git status says that nothing has changed, so I presume the change that actually did the trick was the newly generated solr/data folder (which is in my .gitignore).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants