Kudos to a great module! I am new to Drupal, so it's going to save me a lot of time.

I am using Apache Solr (6.x-2.x-dev) as my default search. The search block layout we're currently working on is: "Search: [type] [keywords] in [location]" - where [type] is a drop-down content type list, [keywords] is text entered by user and [location] is a city/state or zip code value.

This module made it easy to set up [type] as a single-value drop-down. I included 'Entire site' for the '-Any-' option. When I execute a search, however, here's what happens:

Test 1: Select 'Entire site' and enter [keyword] value.
Works as expected. The result URL is: .../search/apachesolr_search/[keyword].

Test 2: Select [type] value and enter [keyword] value.
Test fails. The result URL is: .../search/apachesolr_search/[keyword]%20type:[type].
For the Solr search to work correctly, the URL should be: ../search/apachesolr_search/[keyword]?filters=type:[type].

Is there something I need to configure differently (like Custom Paths) for it to work properly?

On a related note, if issue #926508 - Custom Search Paths and the Label Text - is addressed, I'll go that route to collect search criteria (type and keywords) from the user. Again, awesome job with this module! Thanks for your help.

Comments

jdanthinne’s picture

Status: Active » Needs review

Don't change anything… I've just commited a new DEV version.
The URL should be ok now. Please review.

wuwei23’s picture

I've just moved from 6.x-1.4 to 6.x-1.x-dev, as I've just noticed this problem.

Now every search using the search form block fails, as they're all trying to resolve to this URL:

/search/apachesolr_search/[keyword]%3Ffilters%3D[keyword]

Searches using the basic search form on the results page work fine.

jdanthinne’s picture

Mmm... just uploaded a new DEV version.
Please test and review when available.

rhymeswithcamera’s picture

I tried the 10/26 DEV version and ran into the same issue as @wuwei23. I could not use the custom search form to do simple text searches.

I just downloaded the new 10/27 DEV version, and it's better (yay!), but I'm still running into a few issues:

Test 1: Select 'Entire site' and enter [keyword] value.
Test fails. This previously worked. The result URL is: .../search/apachesolr_search/[keyword]%3Ffilters%3D.
Fix: Remove everything after "[keyword]".

Test 2: Select [type] value and enter [keyword] value.
Test fails. The result URL is: .../search/apachesolr_search/[keyword]%3Ffilters%3Dtype:[type].
Fix: In the URL, if I replace "%3F" with "?" and "%3D" with "=", the URL is correct and the search results come back as expected.

I've tested in both Firefox and Chrome. Same results. Looks like it may be a URL encoding issue - which I know nothing about. :)

A big thank you for your attention on this!

jdanthinne’s picture

Status: Needs review » Needs work

Yeah, I don't why Drupal converts all my special chars to url encoded values. It's the core of the problem :-)
Still investigating…

rhymeswithcamera’s picture

Good luck!

Now that you've provided the code for the Jquery selector option, I've changed my content type selector from a drop-down to checkboxes - and performed test 3 with these results:

Test 3: Enter [keyword] value and check off two types.
Test fails. The result URL is: .../search/apachesolr_search/[keyword]%3Ffilters%3Dtype:[type1]%2B[type2]
Correct URL: /search/apachesolr_search/[keyword]?filters=type:[type1]%20type:[type2]

Looks like Type selection needs to be prefixed with "type:".

jdanthinne’s picture

Status: Needs work » Needs review

I've found a workaround for the url encoding (needed to pass absolute paths).
And I've changed the behaviour for multiple types as requested in #6.
Please test and review the new DEV (should be available in a few hours).

askibinski’s picture

Current dev works fine with apache solr.

tested with a search which was limited to 1 content-type.
Result page was at /search/apachesolr_search/[keyword]?filters=type:[content-type]

jdanthinne’s picture

Status: Needs review » Fixed

Great. One more bug in the grave!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.