I haven't had time to investigate this fully but is it possible for this to work with a customised search form?

For example,
If I have a custom apache solr search page that has additional form elements that can be used for searching.
Then in hook_apachesolr_modify_query() I add the input from these fields to the search.
When I add apachesolr_ajax and use this search page apachesolr_ajax works but my added form elements don't get included.

Is this kind of functionality possible using apachesolr_ajax or would it be a huge amount of effort?

Comments

geerlingguy’s picture

Subscribe.

marthinal’s picture

Subscribe.

marthinal’s picture

@Agileware : i need exactly that you talk about but at the moment triying without ajax .im interested in ajax posibilities also :)

If you have a moment my issue is here :
http://drupal.org/node/963118

i dont know how you take the input from the fields in hook_apachesolr_modify_query().

And sure it will help others one day i hope :)
I dont need full full explanation only concepts helps me to continue working.
Thanks for your time.

jpmckinney’s picture

Category: feature » support
Status: Active » Postponed (maintainer needs more info)

apachesolr_ajax executes the same code as apachesolr on its own:

$return = menu_execute_active_handler('search/apachesolr_search/'. search_get_keys());

So your form_alter's should run all the same.

Are you saying your altered forms are not showing up on the rendered page? Or are you saying that after submitting the form, your hook_apachesolr_modify_query() is not being run? Or do you mean that your additional form fields are not being sent to the server?

jpmckinney’s picture

Category: support » feature

Actually, looking more closely, only the keys in the form are used:

return Drupal.apachesolr_ajax.navigate($('#edit-keys').val()); // @todo Add support for retain-filters.

There is no support for any other form elements aside from the text field for search keys.

I am unlikely to add support for this, as I don't need it myself. I am accepting patches, though.

jpmckinney’s picture

Title: Can this support form_altered search forms? » Add support for additional search form fields
Category: support » feature
Status: Postponed (maintainer needs more info) » Active