I'm using Apache solr views and views 3 to create a separate search for products. That works fine, but I can't "filter by price" facet of this module. In the search view you have to define an argument for the filters where you want to search for (eg "Apache Solr: Taxonomy terms" will make it possible to use a facet search with a taxonomy term). It's currently not possible to add an argument for something like "Selling price" in the view, so the filter doesn't work. It's visible, but nothing happens when you click it.
Any idea what you need to make it possible to select product fields as views arguments?

CommentFileSizeAuthor
#5 apachesolr_ubercart_views.patch4.59 KBjrust
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nick_vh’s picture

I suppose you will have to supply me with a patch for the module in order that this module works nicely together with views 3 apache solr integration ;-)

What I would suggest for an easy fix is to alter the query from the views in code and look how it's being built up.
If you are able to find out how to alter it, and which extra argument you would like to add it should be an easy process

amen’s picture

I'm also very interested in this. I'll take a look at it and hope my programming skills rise up to the task.

dronacarya’s picture

There's a possible solution @ #728088: Add support for CCK Decimal fields and Numeric Facets.

I don't think it's an apachesolr_ubercart issue. The "problem" is with apachesolr_views. You have to tweak the module to accept numeric fields as arguments.

Nick_vh’s picture

Status: Active » Closed (duplicate)

Sorry for not responding earlier. Busy Christmas times for all of us :-)

Good luck in solving it. If I can help by reviewing or adding a patch here and there I'd be glad to.
For now setting this to duplicate then.

jrust’s picture

Category: support » feature
Status: Closed (duplicate) » Needs review
FileSize
4.59 KB

The attached patch exposes all of the fields indexed by apachesolr_ubercart to apachesolr_views. This allows any of the apachesolr_ubercart fields to be used in sorting or as arguments for apachesolr_views. The ability to use them as arguments also has the added benefit of making the facets work on the views pages as well (though you still need to apply the patch referenced in #728088: Add support for CCK Decimal fields and Numeric Facets).

pebosi’s picture

Tested and working, applied both patches manually.

Nick_vh’s picture

Status: Needs review » Reviewed & tested by the community

Perfect! I will commit this today :)

Anonymous’s picture

Hello,

I've applied the patch and added a price aragument in my view but I receive this error when I try to filter by price.

"The Apache Solr search engine is not available"

The results page is empty.

Should I do something else to make it work ?

Thank you.

Nick_vh’s picture

Since I haven't tested this I hardly have an idea. Maybe you could start specifying which versions you are using?

Anonymous’s picture

My mistake. Forgot to apply the patch from http://drupal.org/node/728088
Sorry...

Nick_vh’s picture

Status: Reviewed & tested by the community » Fixed

Committed

Status: Fixed » Closed (fixed)

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