drupal facet api + search api: empty page (no result) default - search

I'm trying to create a faceted search page in Drupal 7 and it's almost done.
These are the modules I used for faceted search.
*Facet API *Search API *Database search *Search Facets *Search Views *Entity API
I created a page with views for faceted search. There are blocks for filtering etc. Here, the problem is the search page shows all results (entries) default, without filtering. If I apply some filter criteria it correctly shows the results, no problem here.
What I want is to show nothing default, an empty result area in the search page I created.

Have a look at Show facet filter even if there is no result. There's a patch available that let's you show facets on "no results found" search.
From what I understand that may be what you're looking for…

I have done the similar thing using this article.
Only difference is that i have exposed filters rather then facet filters. But this will give you idea how to do so.
Hope this will help.

Related

Cloudant/Couch db pagination in search API - How to skip n number of records

I am building a typical pagination that allows the user to click on a particular page number and view the results (similar to the google search result view). I am using the cloudant search API for this. The cloudant search API provides the limit option but no skip option. How can I skip n number of results if the user is on page 1 and clicks on page 4 ?
I can see that the pagination is implemented using bookmarks. Does it mean that I need to first get the bookmark for page 4 by sending 3 additional requests one after another to the search api ?
There are a couple of different ways of handling this - one is the one you already suggested, which is just to fetch the pages as needed to get the bookmarks. I'm not sure there are many alternatives for search results where we can't pre-calculate the results.
Another alternative, and this depends a bit on the details of what you are trying to do, is to create a view containing the data and use the keys to narrow down the view to the results you need. View outputs support use of limit and skip which would enable you to implement pagination.
There's also a good example of pagination in the docs: http://docs.couchdb.org/en/2.1.0/ddocs/views/pagination.html

Jqgrid - How to perform search locally for entire data set,without considering the pagination

Jqgrid -Search functionality -
How to perform search locally for entire data set,without considering the pagination.
I have nearly 1500 records in my database and jqgrid has pagination .
So if I search for something,it should perform search with entire dataset irrespective of the page in the grid and it should not request database everytime ,it should be loaded only once.
Thanks In Advance
If I correctly understand your problem, then you should use lastSelectedData option, which returns, in contrast to data, filtered and sorted data items from all pages of jqGrid. The demo demonstrates the usage of lastSelectedData. It's important that the option exist in free jqGrid fork only (the fork, which I develop). If you have to use an old jqGrid version then you can follow the old answer, which describes more tricky alternative.

How can I crawl but not index web pages in OpenSearchServer?

I'm using OpenSearchServer to provide search functionality on a web site. I want to crawl all pages on the site for links to follow but I want to exclude some pages from the index. I can't work out how to do this.
Specifically the website includes a shop that has its own product search and I am keeping this search for products and categories. The product pages have URLs like http://www.thesite/p/123 so I don't want to include any page like this in the search results. However some product pages reference background info pages and I want these to be included in the search index.
The problem I have is that the filter has no effect on the results - it doesn't filter out the /p/ and /c/ results. If I change the filter by unticking the negative box I get no results so it seems to be either the contents of the field or the filter criteria that is causing the problem.
I've tried adding a negative filter to the default query called search in the Query > Filter tab on the index with url:"http://www.thesite/p/*"
but it seems that wildcards are not supported for query filters although they are supported for Crawler > Exclusion list filters.
I've tried adding a new field called urlField in Schema > Fields and populating it using an analyzer configured using the Whitespace Tokenizer and a regular expression (http://www.thesite/(c|p)/). When I use the Test button it seems to generate two tokens for my test URL http://www.thesite/p/123:
http://www.thesite/p/
p
I'd hoped to be able to use the first one in a Query > Filter to exclude all the shop results and optionally be able to use the p (for product) or c (for category) if I need to search the product pages sometime in the future.
The urlShop field in the schema is set up as follows:
Indexed: yes
Stored: no (because I don't need the field back, just want to be able to filter on it)
TermVector: No
Analyzer: urlShop
Copy of: url
I've added urlFilter:"http://www.thesite/p/" to Query > Filters with the negative box ticked.
This seems to have no effect on the results when I use the default renderer.
To see whether it affects the returned results I unticked the negative box in the query filter I get no results in the default renderer. This leads me to believe that the urlShop field is not being populated but I'm not sure how to check this directly.
I would like to know whether there is an easier way to do this but if my approach makes sense in the context of OpenSearchServer please can you help me identify what's wrong?
The website is running under IIS and OpenSearchServer will be configured on the same server running in Tomcat.
Finally figured this out...
Go to query and hit edit for your configured query. Then go to the filters tab. Add a query filter like this:
urlExact:"http://myurltoexclude*"
Check the "negative" box. Click add.
Now make sure to click "save in the tiny little button on the right hand side. This is the part I missed. The URLS are still in the DB and crawl, but at least they aren't returned in results.

TreelistEx field with Search

I have a requirement from a client to modify the treelistex field to include a search box on top of the left content tree list box. This will allow searching of items instead of the user having to click through the content tree. This Sitecore installation has pages numbering in the thousands hence clicking through takes time and knowing where the page item exists.
How can I achieve this functionality? I will use the _system Lucene index from Sitecore to search the various items. The items need to be search based on item name, title field, content field and date fields.
Thanks
Interestingly, something just like this was posted to Shared Source the other day! Check out the Specialized Treelist from Shared Source.
Search using the built in Sitecore Lucene indexes

Solr Facetting - Showing First 10 results and Other

I am implementing a solution in Solr where I have a lot of values in my facet.
As opposed to displaying a long list of values(facets) down the side of my page I want to display the top 10. And also have one for other.
For instance I would be faceting on Nationality.
So, I do not want to have a list of every nationality, Nor do I want a "see all" button.
What I require is the top 10 nationalitys and then "Other".
When a user clicks on other, it facets on this?
This is quite easy in Solr.. All you need to do is add a
&facet.limit=10
e.g.
http://solrserver:8080/solr/select&version=2.2&q=solr&start=0&rows=0&indent=on&facet=on&facet.field= nationality&facet.limit=10
to your request and you should be able to limit the results.
For more information you can check out my blog post on faceting in solr:
http://www.craftyfella.com/2010/01/faceting-and-multifaceting-syntax-in.html
or the solr wiki here:
http://wiki.apache.org/solr/SimpleFacetParameters#facet.limit

Resources