I am having a problem when querying for search process with Firebase Rest api. I use the startAt and endAt parameters for the first and last search, but it still doesn't list it.
https://myprojectdemo.firebaseio.com/posts.json?orderBy="title"&startAt="Car"&endAt="Car\uf8ff"&print=pretty
I make a GET request this way.
"-WE2QEYJx8gaOUkOsvWkV": {
"title" : "Red Car",
"category" : "Other"
},
"-WE2KSBJx8gaOUkOsvWkV": {
"title" : "White Car",
"category" : "Other"
}
I have an output like above.
There are two shipments titled White Car and Red Car. When I search for car, I want both of them to come out. Where am I making a mistake?
It looks like what you're trying to do is find strings the end with some substring. You can only search for strings that begin with some substring. Realtime Database does not support substring queries in any other way except for string prefixes.
If you want to be able to search for items that are cars, consider adding another piece of data to each child indicating that it is a car type object, and use that to filter your result set. Using the title as you have it now will not work.
Related
We're using Google Cloud-Search and searching a particular datasource for "O'Conn*" doesn't returned any results.
...
"valueFilter": {
"operatorName": "lastname",
"value": {
"stringValue": "O'CONN*"
}
...
The field is set as wildcardsearchable:true and all the records were re-indexed after. The datasource contains over 40 records that should match. The wildcard search does work but not for any wildcard search terms that contains a single quote ('). Here's a few test I've done
"O'CONN*" - No match
"*CONN*" - Plenty of matches including "O'Connor"
"O'CONNOR" - Matches all "O'Connor" (not a wildcard search)
Would you know a way to perform the search? Do we need to escape the single quote in anyway?
I thought about replacing the single quote by another character, removing it or adding an alternative form of the term before indexing, but then we'd be opening a can of worm. Needing to process search terms before sending, detect and update before the field is displayed on our search result page, etc...
I found a post that likely explains why I'm experiencing this behaviour, but it's for Lucene search. I couldn't find a setting similar to the one described in that post in Google Cloud Search settings or documentation.
Thanks
I tried:
Escaping the single quote in different ways;
Putting the wild card character at different position to test different theories
I've search Google's documentation for "Cloud Search wildcard single quote", but no satisfactory results.
Im new to Kibana and there is this doubt regarding it. I was trying the "hits" panel type with my query and then there was this "total" style in it. The other styles like the "bar" and "pie" returns understandable graphs,where as I cant figure what "total" is doing. Can somebody explain?
"Total" displays the total hits for all the queries.
That is if we search for a query say "query 1" and we get say "n" hits, it will be shown as the number.
Now we clear the first one and we search for a second query, say "query 2" and it returns "m" number of hits.
Then if we use multiquery option and search for both "query 1" and "query 2" the total style would show "m+n" hits as the result.
To know more about the "total" style you can refer
here
The following screenshots will be helpful for you to understand the "total" style in hits analytics
Suppose my first query is "spiderman"
You can see the the hits to be 24700
Next I type in a second query "ironman"
You can see the hits to be 2864 here.
And now we type in both queries using the multi-query option, which returns the following results:
Here you can see that the total hits to be 27564, which happens to be the sum of individual hits (24700+2864).
Is it possible to get a users first name or surname from a freebase query?
For example, I have a person entry I have the id of, but I just want to extract their first name.
{
"id": "/en/paul_thomas_anderson",
"name" : null
}
How would I modify this query, its something I've found nothing about by googling or searching here on S.O.? I know this kind of thing is possible in dbpedia for most people entries.
No, it's not possible directly. The name is stored as a single unit. There are topics for given names and surnames (e.g. http://www.freebase.com/view/base/givennames/given_name), so you could split the name and see which list(s) it appears in, but that's indirect and doesn't tell you about the specific person you are querying.
How can I obtain the names from the mids in Freebase? In the following table_row in music/album table we have the following album names(?) provided in mid.
music|artist|name id origin active_start active_end genre label home_page acquire_webpage album contribution track track_contributions concert_tours supporting_artists|Jimmy Johnson /m/01wz6jx Rock music,Jazz fusion,Jazz,Folk rock /m/01wz6kq,/m/01wz6kx,/m/01wz6l8,/m/01wz6kj,/m/01wz6kb,/m/01wz6l2,/m/01wz6lg /m/0fjw1yt,/m/0dt2p4t,/m/0fbpmv2,/m/0ffbzh3,/m/0f7y3jb,/m/0fgb1g1,/m/0dy5n14,/m/0fgn9xv,/m/0dzbwfr,/m/0f6hyd3,/m/0fj70dm,/m/0ff_qzm,/m/0f9_cm4,/m/0f7l2cj,/m/0fkhd4j,/m/0flf7j8,/m/0flr1z_,/m/0fl3c6q,/m/0ffp8g9,/m/0f64lc8,/m/0fgzlz2,/m/0f885wn,/m/0fktd7t,/m/0d_j0p6,/m/0dv915z,/m/0fm0 _t2
If I query Freebase like this: [{
"mid": "/m/01wz6kq",
"name": null
}]
then I obtain a "null" for name. How can I obtain the names? Are these mids at all pointing to named entities? If I use the freebase website like this: http://www.freebase.com/view/m/01wz6kq then I obtain Contributor: Jimmy Johnson
Album: All Night Wrong meaning that the album name exists.
However, if I use: http://api.freebase.com/api/experimental/topic/standard?id=/m/01wz6kq i.e. the TOPIC API, then the information is "extractable" from the text field. Is this the way to do it? or is there any other easier way?
A better view of this data if you're doing programming is the explore/inspect view:
http://www.freebase.com/inspect/m/01wz6kq
As a matter of fact, it even gives you a little shortcut for building a query. If you click on the arrow to the left of the /music/recording_contribution/album property, you'll get a pre-built query which you can modify to fetch the name instead of the ID:
{
"id": "/m/01wz6kq",
"/music/recording_contribution/album": {
"name": null
}
}
If you click on the Link button in the Query Editor you'll get an MQLRead link that gives you back JSON you can parse to get the name.
Of course if you were doing this in the program, you'd construct the URL on the fly from a template with the ID of interest inserted.
NOTE: you do not want to be doing anything that references api.freebase.com because that's going away soon. You should be using the googleapis.com endpoint.
This entity has no /type/object/name property
BTW
If you want to extract entity names, there are some properties:
/type/object/name
/common/topic/alias
and wikipedia keys, which need to be processed in some way (replace "_" with space, "&" with "&", "$1234" with some unicode symbol)
I have a Dojo DataGrid with several fields. I'm currently setting the query to search one field at a time, like so:
grid.setQuery( {name:"Bob"}, {ignoreCase:true} );
However I would like the query to search all the fields at once. For example say I have three fields titled "name", "friend", "family". Let's say I only want the rows that contain "Bob" in any of the three fields to show in the grid. How would I got about doing that without three separate queries?
Any help is appreciated.
Is your store an ItemFileReadStore or a QueryReadStore?
If ItemFileReadStore you may be able to utilize the AndOrReadStore
http://dojotoolkit.org/reference-guide/dojox/data/AndOrReadStore.html
Otherwise, my best suggestion for a limited fetch store would be to adjust your back-end code to support filtering options such that when the store makes a POST(or GET), you parse out an array of fields that you want to search against, and the result set is returned accordingly.
You'd see something like
start 0
count 25
columnsToQuery : ["name","friend","family"] //or perhaps a CSV string will do
columnOperator : "AND"
columnValue : "Bob"
You'd have to adjust the paradigm as per your business needs, but as long as the server can properly return the result set based on the filtering inputs this approach will work.
The call to generate such a request would be
grid.setQuery({
columnsToQuery : ["name","friend","family"],
columnOperator : "AND",
columnValue : "Bob"
});