Hi,

I would like for the user to be able to select some terms (through checkboxes for instance), and then click search (without entering anything in the search box), so that he gets all the results corresponding to what he already filtered.

Would that possible in any way (without using Solr Views Integration) ?

CommentFileSizeAuthor
#13 f1.png99.01 KBqasimzee
#13 f2.png97.89 KBqasimzee

Comments

fourmi4x’s picture

Or maybe a simpler variant :

Is it possible to display a page with Solr facets, but without any results at the beginning, and without a searchbox too? And then, when the user click on a facet it launches the search (without any text entered because there is no searchbox, so the search is run on all the content indexed, or even better on specific content types) ?

Any help building this solution will be truly appreciated !

qasimzee’s picture

I think I also badly need this. I highly appreciate the effort made by the developers of this module. I just don't understand that if we have no option of selecting multiple terms in a facet block (either CCK or Taxonomy) then why these are "checkboxes". In web development, when checkboxes are used, those specifically means that we want to allow users to select multiple options. But the checkboxes generated by this module are behaving like "radio buttons". I would like to present a classic difference between both these options. Please check http://dinosaurs.findthebest.com/

qasimzee’s picture

If anyone has any patch about that, please please please share with me.

Thanks

marthinal’s picture

The behavior of apachesolr module checkboxes i think is like this because when you click an option then you filter posibilities(options) in the others facets block and the number of results depend directly what did you select before .I dont know if mainteners would like to change it :) .

So maybe if you need to change it you need to develop a custom facet for your needs.

jpmckinney’s picture

Status: Active » Fixed

#2: I don't think the facets behave like radio buttons - when you select a new facet, it doesn't deselect the old facet. It does the union of the two facets and filters results by both.

#1: I think you can do this by going to admin/settings/apachesolr and setting "Behavior on empty search" to the behavior you want.

qasimzee’s picture

Status: Fixed » Active

@jpmckinney: For #2: When you select a facet, it entirely removes all other checkboxes and it seems to be the behaviour of radio buttons and you can't check two checkboxes at the the same time of a single facet block.

jpmckinney’s picture

That's odd. That's not how the module used to work. Maybe someone buggered 6.x-2.x while I was gone.

jpmckinney’s picture

What's the URL look like before and after you click the link to add a second facet?

qasimzee’s picture

I have a CCK text field ss_cck_field_rack_material that have two allowed values ("Stainless Steel" and "Nylon") when I select any filter from that cck field the URL becomes like "ss_cck_field_rack_material%3A"Stainless Steel" and "Nylon" checkbox disappears.

I want to do a checkbox work like on http://dinosaurs.findthebest.com/ (mentioned above also and I hope you checked it)

jpmckinney’s picture

Is this configured on the block configuration page to be an AND facet or an OR facet? Are there nodes that are both "Stainless Steel" and "Nylon" or are nodes only one or the other?

qasimzee’s picture

Yeah, on block page, it's configured as "OR".
Both "Nylon" and "Stainless Steel" type of nodes are available but there aren't any node that is both "Stainless Steel" and "Nylon". A node can be either "Stainless Steel" or "Nylon"

I just want that when block is configured as "OR" or and on facet when I check "Stainless steel", "Nylon" checkbox should keep appearing as "unchecked"(just like on the link I gave)

jpmckinney’s picture

I can't reproduce this behavior.

qasimzee’s picture

StatusFileSize
new97.89 KB
new99.01 KB

Can you share some screenshot? I have added mine. Please take a look. When I checked "Stainless Steel", "Nylon" totally disappeared.

efmo’s picture

I am experiencing the same issue, i.e. checkboxes acting like radio button...

jpmckinney’s picture

Try again with the latest dev code. #883106: move the OR facet code to the finalize hook. may have changed things.

qasimzee’s picture

Seems fine with the latest dev version 6.x-2.x but I don't understand why AND stopped working. Now if we set facet type as "AND" in block settings, the results are not filtered. Anyone else noted?

jpmckinney’s picture

Can you post screenshots as you did before?

qasimzee’s picture

Well, I actually reverted the code after a lot of struggle What happens is that filtration is not at all applied. The same results are returned whenever you click any checkbox if facet type "AND" is selected.

jpmckinney’s picture

Title: Filter on multiple terms at once, before search is launched » AND facets are not working/filtering?
Category: support » bug
qasimzee’s picture

Any updates on how to fix it?

qasimzee’s picture

Just noticed that Taxonomy OR facet is also not working. Only CCK OR operator in working in latest dev release

jpmckinney’s picture

Title: AND facets are not working/filtering? » AND facets and taxonomy OR facets are not working/filtering?
jpmckinney’s picture

Title: AND facets and taxonomy OR facets are not working/filtering? » AND facets are not working/filtering?
jpmckinney’s picture

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

Is the apachesolr_search module enabled? AND and OR filters will not work without it. If you are using subqueries (e.g. using apachesolr_access), there may be a bug with respect to subqueries. Otherwise, all such facets should work. According to screenshots in #13, that facet is behaving as if the operator is AND.

According to #16, CCK OR facets are working fine. I need more info (in particular, screenshots with URLs) to understand what you mean when you say AND is no longer working. Taxonomy OR facets do not work correctly for a different reason (as per #920892).

pwolanin’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)