How to fetch all the facets from cloudsearch - amazon-cloudsearch

On cloudsearch we can fetch facet information by passing facets.FIELD parameter in query, but I want cloudsearch to return all the available (returnable) facets. Is there a way we can do it? I have many facets which have return enabled.

There is no way to retrieve facet information for all facets -- you must explicitly specify each facet you're interested in, eg to get the values for facets FOO and BAR, your query would specify:
facet.FOO={}&facet.BAR={}
Here are the faceting docs if you haven't seen them: http://docs.aws.amazon.com/cloudsearch/latest/developerguide/faceting.html
I also want to make sure you're not confused about what 'return enabled' means. That means a field can be included in search results and it is unrelated to facets. I'm guessing you meant that the fields are FacetEnabled. You can read more about that at: http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-index-fields.html

Related

SPARQL triple filter is not an exact match

I am using an IBM wrapper solution around SPARQL to get information from our database. I set a triple variable to act as a filter but it doesnt return an exact match, only a 'contains' match.
More specifically, we are looking at requirements that live in a collection. The SPARQL query returns all requirement objects and the collection that they live in. Each collection has a unique identifier associated with it which is accessed via the predicate 'dcterms:identifier'. The exact line in the SPARQL code which does this is:
?oslc_rm_RequirementCollection1_uri dcterms:identifier ?oslc_rm_RequirementCollection1_identifier
This works as expected. In the output I get a table containing each collection with the list of requirements associated with each one.
The problem arises when I want to look at requirements in only a specific collection. To do this I set the variable oslc_rm_RequirementCollection1_identifier in IBM's wrapper, and it generally works. If I enter '18732' it only shows me requirements from the collection with id 18732. However, this is not an exact match only a contains. For example if I enter '867', I am shown two collections: 867 and 38674.
How can I modify this to exclude 38674 and only show the exact match? I cannot use a string literal because the wrapper does not allow this.

Is there a way to properly experiment with Solr field-types?

I'm working with Solr for a basic search engine, and I've created a couple different fieldTypes that include various filters and tokenizers in their analyzer chains.
However, I'm finding it very difficult to assess how these components of the chain interact and when I query in the Solr Admin, I consistently get different results than I expect-- with no clue as to why.
Is there a way to see what a phrase like education:"x university" is being transformed into when I type it in the q section of the Admin?
Also, when the phrase goes through the chain can it be transformed into multiple things that are all searched or is it just a single modified phrase?
Thanks for any help!
Use Analysis in Solr Admin to check how each field and its type process the tokens both while querying and indexing.
Analyse Fieldname / FieldType:
from the drop down option select field/type that you want to analyse and clieck on Analyse values.
ex: what tokenizer used, which all filter classes applied to token and how token is transformed after passing each filter class.
if
Verbose Output is checked, it shows more details about each filter class used for the selected field/type.

Google Places API - RadarSearch results are confusing

I'm running a query vs the Google Places RadarSearch API and don't entirely understand the results. I'm trying to find nearby Tesco Supermarkets. My query is structured like this:
https://maps.googleapis.com/maps/api/place/radarsearch/xml?location=51.503186,-0.126446&types=store&keyword=tesco&name=tesco&radius=5000&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I've tried a bunch of variations of the fields types, keyword and name. None of the results are Tesco stores. Am i missing something?
The Google docs show the fields as:
keyword — A term to be matched against all content that Google has indexed for this place, including but not limited to name, type, and address, as well as customer reviews and other third-party content.
name — One or more terms to be matched against the names of places, separated by a space character. Results will be restricted to those containing the passed name values. Note that a place may have additional names associated with it, beyond its listed name. The API will try to match the passed name value against all of these names. As a result, places may be returned in the results whose listed names do not match the search term, but whose associated names do.
I always get the maximum of 200 results which maybe includes 1 or 2 Tescos. When I check on Google maps there are 10 Tescos in the radius I am searching. It's as if the api is ignoring the name field. It doesn't matter what I populate in the name field, I still get the same results
UPDATE: Seems this is a known bug https://code.google.com/p/gmaps-api-issues/issues/detail?id=7082
maybe I am wrong, but I believe it is a commercial issue, google will show all business filtering them with a particular criteria they are no publishing the rules, for example in your search, the type you used was "store" , so they are returning to you all stores, and using the name or keyword in their own way who knows which criteria they are internally using, and there is something else, on the API description, the sample that they provide for radar search shows the name of the place in the result, but in the tests i am doing, they are not even sending the name, so you couldn't iterate those results, and filter by your own, for you to get the name, you have to do another call using:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJq4lX1doEdkgR5JXPstgQjc0&key=YOUR_KEY
Maybe there is another way but I don't see it.
I find the radar search is returning strange results today. It worked differently a couple of days ago.
The keyword-parameter has no effect at the moment and I have breaking integration-tests that were working before. I hope this is a temporary issue.
I filed a bug report for it: https://code.google.com/p/gmaps-api-issues/issues/detail?id=7086

Show fields for a Lucene/Elasticsearch index

Is there a way to get Lucene/Elasticsearch to just show what fields have been indexed in a given index? I'm trying to figure out whether certain fields have been indexed properly as a result of configuration options, but I have no idea how to make that determination.
You can check the mappings for a specific index and type via a call to:
http://localhost:9200/index/type/_mapping
Anything indexed should have an entry there.
See also analyze API to see how text is broken into terms.
http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html

determine which value produced a hit in SOLR multivalued field type

If I have a multiValued field type of text, and I put values [cat,dog,green,blue] in it. Is there a way to tell when I execute a query against that field for dog, that it was in the 1st element position for that multiValued field?
Assumption: client does not have any pre-knowledge of what the field type of the field being queried is. (i.e. Solr must provide the answer and the client can't post process the return doc to figure it out because it would not know how SOLR matched the query to the result).
Disclosure: I posted to solr-user list and am getting no traction so I post here now.
Currently, there's no out-of-the-box functionality provided in Solr which tells you the position of a value in a multiValue field.
Hopefully I understand your question correctly.
If you want to get field index or value there is an ugly workaround:
You could add the index directly in the value e.g. store "1; car", "2; test" and so on. Then use highlighting. When reading the returned fields simply skip the text before the semicolon.
But if you want to query only one type:
You can avoid the multivalue approach and simply store it as item_i and query via item_1. To query against all items regardless the type you need to use the copyField directive in the schema.xml
The Lucene API allows for this, but I'm not sure if Solr does out of the box. In Lucene you can use the IndexReader.termPositions(Term term) method.