Hi,
I am using getlocations fields to get the user to fill his location and now I want to display a facet based on the city which we get from the getlocations fields and also I want to display the name which we get from getlocations fields as a sub-facet for the corresponding city but I am unable to do it.

CommentFileSizeAuthor
#5 get.png190.67 KBminu-aswanth

Comments

hutch’s picture

I don't know "facet".

minu-aswanth’s picture

Hey hutch,
I am using search api + facet api to filter for searching. By facets, I mean the filters displayed in the right side in the attached image.facet api example

hutch’s picture

All the address and location information stored by Getlocations_fields can be indexed and listed by the Drupal search system and (I'm told) works fine with Apache Solr, so wether it works with Facet or not will depend on how Facet works with the builtin search utilities, which in turn will depend on which modules you are using, a search on the drupal contributed modules list shows a good many modules that work with Facet so find the one(s) that do what you want and you will have a solution.

minu-aswanth’s picture

The problem here is that I have indexed the city field in the getlocations fields and I am trying to display a facet based on that but instead of displaying only the cities, it displaying only the cities, it displays everything as shown below.Only local images are allowed.

minu-aswanth’s picture

StatusFileSize
new190.67 KB

The problem here is that I have indexed the city field in the getlocations fields and I am trying to display a facet based on that but instead of displaying only the cities, it displaying only the cities, it displays everything as shown below.

hutch’s picture

To get to the data that you want you need to copy function template_preprocess_search_result() from the file search_pages.inc in the search module to your theme's template.php (renaming it to suit of course) and also copy search-result.tpl.php and optionally search-results.tpl.php to your theme, then you can edit things to get the data you want, in particular look at the $result variable in function template_preprocess_search_result() which contains everything.

minu-aswanth’s picture

Hi,

Thanks for the reply, but I dont quite understand why / how this will help. Recently started dabbling with drupal.

I found the template_preprocess_search_result, and search-result.tpl.php, But these are the files that control how the teasers and so on will get displayed. Does this control facet api ?

Also, I am unsure as to what to name the function template_preprocess_search_result as in the template.php file.

hutch’s picture

First of all, this issue queue is for problems with Getlocations and its sub-modules, your problems are to do with the Drupal search system. Getlocations_fields has been written to ensure that all the fields are searcheable and that works fine, any data entered into a getlocations_fields instance can be found by the search module. What you are apparently doing is trying to extend the search module with a third-party package called "Facet" and it is not working the way you expect it to. This has nothing to do with Getlocations, you need to read the documentation that comes with Facet, if any.

If you want to know more about how to use Drupal I would suggest that you read the documentation pages. There is a whole section on theming and it is there that you will find out how to rename things (hint: same as all the other examples in template.php, have a look at the builtin themes)