Kibana search query using regular expression - search

I want to search url include a-id and b-id.
But i can't write search query for data has b-id
example url: "/aaa/{a-id}/bbb/{b-id}"
my search query(but isn't not working): "/aaa" AND "/bbb/*", "/aaa/*/bbb/*"
query result is...
/aaa/1/bbb
/aaa/2/bbb
/aaa/3/bbb/1 -> i want only this format
/aaa/1/bbb
/aaa/2/bbb
/aaa/3/bbb
How can i see only this format (/aaa/{a-id}/bbb/{b-id}??
Please tell me query for kibana ui.

Related

twitter premium Api buid a search query with colon

I have a twitter premium API enabled and i am trying to get twitter data from a request query
search query rules
few words are in twitter body or in hashtags
language japanese
skip retweets
within date range
and some default parameters
I don't use any twitter API client library,I have created own small library to authentication and get the results.This issue with the search query because i am getting twitter data for other queries as expected.
query i have tried
{ "query":"lang:ja(-is:retweet((Reゼロ OR Re:ゼロ) OR (#Reゼロ OR #Re:ゼロ) ))",
"maxResult":500,
"fromDate":somedate,
"toDate":somedate
}
response is a error saying
There were errors processing your request:missing EOF at '(' (at
position 8)
I tried these methods,did't work.
"lang:ja(-is:retweet((Reゼロ OR "/Re:ゼロ/") OR (#Reゼロ OR "/#Re:ゼロ/") ))"
"lang:ja(-is:retweet((Reゼロ OR 'Re:ゼロ') OR (#Reゼロ OR '#Re:ゼロ') ))"
as far as i understand colon between word makes the error ex (Re:ゼロ),because if i remove colon it is return the data for query matching. I think colon makes complicated with twitter search operators like is:retweet.
these are some links i have followed
https://developer.twitter.com/en/docs/tweets/search/guides/premium-operators
https://developer.twitter.com/en/docs/tutorials/translating-plain-language-to-pt-rules
how to solve this?

Marklogic QueryByExample in collection NodeJS

TLDR
Is there a way to limit queryByExample to a collection in NodeJS?
Problem faced
I have a complex query with some optional fields (i.e. sometimes some search fields will be omitted). So I need to create a query dynamically, e.g. in JSON. QueryByExample seems to be the right tool to use here as it gives me that flexibility to pass a JSON. However my problem is that I would like to limit my search to only one collection or directory.
e.g. I was hoping for something like
searchJSON = {
title: { $word: "test" },
description: { $word: "desc" }
};
//query
db.documents.query(qb.where(
qb.collection("collectionName"),
qb.byExample(searchJSON)
)).result()...
In this case searchJSON could have been built dynamically, for example maybe sometimes title may be omitted from the search.
This doesn't work because the query builder only allows queryByExample to be the only query. But I'd instead like to built a dynamic search query which is limited to a collection or directory.
At present, I think you would have to express the query with QueryBuilder instead of Query By Example using
qb.and([
qb.collection('collectionName'),
qb.word('title', 'test'),
qb.word('description', 'desc')
])
See http://docs.marklogic.com/jsdoc/queryBuilder.html#word
That said, it should be possible for the Node.js API to relax that restriction based on the fixes in MarkLogic 9.0-2
Please file an issue on https://github.com/marklogic/node-client-api

Extract facets based on tags in Query Builder

I am trying to extract the facets using Query builder in AEM. My query is as below:
1_group.p.or=true
1_group.1_type=cq:Page
1_group.2_type=dam:Asset
2_group.p.or=true
2_group.1_path=/content
2_group.2_path=/content/dam
3_group.p.or=true
3_group.1_tagid=/etc/tags/geometrixx-outdoors/activity/biking
3_group.1_tagid.property=#jcr:content/cq:tags
3_group.2_tagid=/etc/tags/geometrixx-outdoors/activity/biking
3_group.2_tagid.property=#jcr:content/metadata/cq:tags
fulltext=text
p.limit=-1
The Query Builder returns the facets based on the type (cq:page, dam:Asset) for the above query, but I need the facets based on the tags. Is there any way, I can explicitly provide the parameter on which the facets are required. Also, please suggest if we can optimize this query to achieve the same.
Thanks,
Shailesh
This issue is fixed now. The mistake was in the tagid.property predicate. It should not start with #.
1_group.p.or=true
1_group.1_type=cq:Page
1_group.2_type=dam:Asset
2_group.p.or=true
2_group.1_path=/content
2_group.2_path=/content/dam
3_group.p.or=true
3_group.1_tagid=/etc/tags/geometrixx-outdoors/activity/biking
3_group.1_tagid.property=jcr:content/cq:tags
3_group.2_tagid=/etc/tags/geometrixx-outdoors/activity/biking
3_group.2_tagid.property=jcr:content/metadata/cq:tags
fulltext=text
p.limit=-1

Twitter search: OR with Tags - but how?

I cannot search the twitter API for tweets which contain one of multiple tags.
Like: q="#tag1 OR #tag2 OR #tag3"
If I leave away the hashes and only search for words, the OR-ing works. For tags they don't.
When I only use spaces, the search terms will be AND-ed, what shrinks the result...
I use the twitter4j library with:
Twitter rest = new TwitterFactory().getInstance();
Query query = new Query();
query.setQuery("#win | #fail");
QueryResult result = rest.search(query);
Isn't it possible, or didn't i use it correctly?
Might just be easier to use twitter's REST API. You'll want to use the search query. Here's an example search url searching for #LA, #NYC or #Boston. Note the spaces and #s are all URL encoded. Just pop a URL like that into a getJSON call like below and you can easily extract your values from the returned JSON object as in the example.
var requestedData = "http://search.twitter.com/search.json?q=%23LA%20OR%20%23NYC%20OR%20%23Boston%22&callback=?"
$.getJSON(requestedData,function(ob)
{
var firstTweet = ob.results[0].text;
var firstTweeter = ob.results[0].from_user;
}
From there it's just a matter of looping through your results and pulling the appropriate fields which are all outlined in the JSON file if you simply visit that example search link in your browser! I don't know this TwitterFactory API but its possible they haven't updated to Twitter's new API or they're just not URL encoding appropriately. Good luck!
Try to use OR operator instead of "|":
query.setQuery("#win OR #fail");
See available Twitter search API operators here:
Using the Twitter Search API

Need to use Solr dismax handler but i have no q parameter???

Hi
i am trying to make a solr Query using dismax handler but i have no q parameters because i have to match directly on fields..
hl.fragsize=200&mm=1&facet=on&facet.mincount=1&qf=text+&wt=json&hl=true&rows=50&fl=*+score&start=0&q=*:*&fq=jSFunT:("Fresher"+OR+"Developer+/+Programmer+/+Coder")&fq=jNMinEx:[2+TO+*]&fq=jNMaxEx:[2+TO+5]&fq=jNMinSal:[-1+TO+*]&fq=jNMaxSal:[-1+TO+-1]&bq=jSFunT:("Developer+/+Programmer+/+Coder")^1&bq=jSkill:(HTML)^2&bq=jCID:(41449)^8&bq=jJT:(Developer+)^8&bq=jLoc:(Mumbai-Thane+)^4&bq=jINDT:("IT(Software,+Dotcom,+Infra.Mgmt.%26+UI+Design)")^1
OR you can better understand it from below..
&mm=1
&qf=text
&wt=json
&hl=true
&rows=50
&fl=*+score
&start=0
&q=*:*
&fq=jSFunT:("Fresher"+OR+"Developer+/+Programmer+/+Coder")
&fq=jNMinEx:[2+TO+*]
&fq=jNMaxEx:[2+TO+5]
&fq=jNMinSal:[-1+TO+*]
&fq=jNMaxSal:[-1+TO+-1]
&bq=jSFunT:("Developer+/+Programmer+/+Coder")^1
&bq=jSkill:(HTML)^2
&bq=jCID:(41449)^8
&bq=jJT:(Java Developer)^8
&bq=jLoc:(Mumbai-Thane)^4
&bq=jINDT:("IT(Software,+Dotcom,+Infra.Mgmt.%26+UI+Design)")^1
Here all the "bq" will not work because the qt=dismax is not supplied if i use that then the whole query will fail
can i any one help me out i will be very thankful for this kindness
Have a look at the q.alt parameter, which lets you specify a fall back query:
q.alt=*:*
If you replace your q parameter with that one, dismax should play just fine.

Resources