Solr Dismax using % in mm parameter give error - apache

I am trying to use the mm (Minimum Should Match) parameter with the dismax parser. If I do just mm=2 or any other int value it seems to work fine. But if I try and add a percent as shown in the able, say mm=60%, then I get an "invalid digit" error for the query. How do I actually use the percentage for mm?
Solr ref guide mm table
(running solr 7.6 btw)

Related

Big Query - extract json field which contains emoji?

In my BQ database table I have a column called payload which contains raw facebook webhooks JSON payloads as string. One of them contains a text with an emoji like Sample 🏦. In big query it look like
{"object":"page","entry":[{"id":"xxxx","time":1602757469275,"messaging":[{"sender":{"id":"xxxx"},"recipient":{"id":"xxxx"},"timestamp":1602757469062,"message":{"mid":"m_xxxx","text":"Sample \ud83c\udfe6","quick_reply":{"payload":"{\"key\": \"value\"}"},"tags":{"source":"source"}}}]}]}
I would like to create a view with a column text with extracted text field value from the raw json. I created an sql like
SELECT
JSON_EXTRACT_SCALAR(payload, '$.entry[0].messaging[0].message.text') as text,
FROM `my_table.facebook.webhook_received`
Sadly the result I get looks like that Sample ��
Does anyone know how to make big query decode the emoji properly or at least just not change it to those � signs ?
Those characters you have embedded are not for a bank icon which is your issue I believe.
Run the following in BQ and it returns the desired emoji:
select " Sample \U0001f3e6"
Ref:https://emojipedia.org/bank/
The two you have provided seem to default to the '?', invalid character
http://unicode.scarfboy.com/?s=U%2Bdfe6
edit: what ever is handling the message maybe throwing the encodings you're seeing in your message which may be the actual problem.
If you are using BigQuery Python client and its load_table_from_json method, there is a Unicode bug (especially its byte is over 0xFFFF, like 🏦) in the previous version, and I have submitted this bug fix which is already included in the latest release include it, https://github.com/googleapis/python-bigquery/releases/tag/v2.24.0. By the way, you should use \U0001F3E6, not \ud83c\udfe6 (UTF-16 hex type) to present 🏦 in your Python code with BigQuery.
Unicode Character 'BANK': https://www.fileformat.info/info/unicode/char/1f3e6/index.htm,
https://charbase.com/1f3e6-unicode-bank

Updating date in fields in project

I have the following problem updating MS Project fields with VBA:
I try this:
For Each t In ActiveProject.Tasks
'The following displays correctly Mo 14.05.18
Debug.Print Format(CDate("14.05.18", " ddd dd.mm.yy"))
'The following results in an error 438 (Method not supported)
t.Datum3 = Format(CDate("12.05.18","ddd dd.mm.yy"))
'this works fine but i'm not able to sort it proberly since it is a text sort for date fields, which is not wanted ...
't.Text25 = Format(CDate("12.05.15","ddd dd.mm.yy"))
Next t
It seems that not the format is a problem (I tried various formats, I even read it from the object to verify with format should be used) but generally, I'm not able to update date fields, I've got these problems with predefined date fields from MS Project as well as with user defined date fields.
Text fields don't make any problems at all.
Run-time error 438: Object doesn't support this property or method
You are getting the run-time error 438 because the Task object does not have a property called Datum3. Even though the field title in the German version is "Datum3", the actual property name is Date3. (see MS Project object model, German version)
Secondary issue
While MS Project will accept date field values formatted as text, it is not necessary and bad form as it implies the date field is text. Instead set the values like this:
t.Date3 = CDate("14.05.18")
Note: The display format for date fields is set in the Project Options (see Change the Date Format or Ändern des Datumsformats).
Rachel's answer is best... but, another approach if your core need is to sort and you are stuck with text, is to use dates in ISO 8601 format: YYYY-MM-DD . See https://en.wikipedia.org/wiki/ISO_8601 for details. Or better yet: https://xkcd.com/1179/ .

Passing encoded url string containing %3A (colon) to an APEX page truncates everting after the last %3A

I am using ORACLE APEX 5.0.1
I am passing an url string to an APEX application where I have encoded all special caracters, if there is one or more %3A (colon) in the url APEX seemes to truncate the value I am passing.
This affects only the last variable I am passing and only the remaining part after the last %3A, but if I place a %3A at the very end of the url it works in APEX.
I have asked about this in other forums and it seems to be a relative unknown issue in APEX, haven't got any relevant answer that explains the issue.
This example pass values to tre fields
"...../apex/f?p=118:32:::::P32_XX,P32_YY,P32_ZZ,:100030,486,VMKF%3AU%202012%3A50"
P32_XX, and P32_YY get the value ok
P32_ZZ only get the value "VMKF:U 2012"
but if I put a %3A at the end of the url like this
"...../apex/f?p=118:32:::::P32_XX,P32_YY,P32_ZZ,:100030,486,VMKF%3AU%202012%3A50%3A"
it works ok and P32_ZZ gets the value "VMKF:U 2012:50".
I have tested this in Windows Explorer 11, Google Crom and Mozilla Firefox (latest version) with the same behavior.
And I have the same behaviour if I use a literal colon (:)
Appreciate the help
The issue is that the colon is a separator for the different parts of the APEX URL. I am surprised that using %3F doesn't fix it, but the solution is to surround the whole value by \...\ like this:
...../apex/f?p=118:32:::::P32_XX,P32_YY,P32_ZZ,:100030,486,\VMKF%3AU%202012%3A50\
Note that you don't even need to escape the colons now:
...../apex/f?p=118:32:::::P32_XX,P32_YY,P32_ZZ,:100030,486,\VMKF:U%202012:50\

Query with "the" not returning results

I'm trying to select an entity with "The" as the first word of the title attribute but Usergrid seems to be ignoring it.
For example, this query which is attempting to select "The Giver"
/books?ql=select * where title contains 'the*' //returns no results
/books?ql=select * where title contains 'giver*' //returns "The Giver"
Is this be design? Why is "the" ignored? Is it some kind of keyword? How could I work around this apparent limitation?
This does not work in version 1.0 of Usergrid (the free tier of Apigee's API BaaS runs 1.0). It is, however, fixed in newer 2.X versions of the Usergrid project. I spent some time digging through for the relevant commit, but couldn't find it.

How to change Unix Timestamp to Human Date in rails 3

I've seen a couple of posts doing the reverse for mysql, but I'm looking for a way to change a unix timestamp to a human readable date (ideally one I can change the format of) and I haven't been able to find anything so far.
I'm storing a date pulled from an XML feed, via NokoGiri (in Rails 3.1.1) as part of a hash:
'date' => i.xpath('#unix-timestamp')
which gets the number fine, but how the devil do you make this DD-MM-YYYY to be put in one of my views?
I've tried Time.at( (i.xpath('#unix-timestamp') ) to no avail; I just get the error 'can't convert Nokogiri::XML::NodeSet into an exact number' and now I've hit a wall
Much gratitude for any help!
Time.at is definitely a call that should work to convert from epoch time to a ruby Time object (see here for an example). So it seems like you need to work on converting your XML result into something more usable. I think you want to try using NodeSet#text to get a string output, then converting that to an integer:
Time.at(i.xpath('#unix-timestamp').text.to_i)
There's a decent but basic tutorial for NokoGiri in the Engineyard blog
You can use like : DateTime.strptime("1373210218",'%s')
and also Time.at(1373210218).strftime("%B %e, %Y at %I:%M %p")