I am trying to post the following json format of the file to solr
{"userName": "Bill", "stars": 4, "review_id": "-TsVN230RCkLYKBeLsuz7A", "type": "review", "business_name": "Eric Goldberg, MD", "user_id": "zvJCcrpm2yOZrxKffwGQLA", "text": "Dr. Goldberg has been my doctor for years and I like him. I've found his office to be fairly efficient. Today I actually got to see the doctor a few minutes early! \n\nHe seems very engaged with his patients and his demeanor is friendly, yet authoritative. \n\nI'm glad to have Dr. Goldberg as my doctor."}
However I get the error
Response: {"responseHeader":{"status":400,"QTime":32}," error":{"msg":"Unknown command 'user_name' at [12]","code":400}}
while I am trying to do
post.sh -c coreName fileName.json
This is driving me crazy. I have unloaded the core and created it again to see if previous attempts to post files is causing this error. But that did not help.
Solr is looking for a command (like 'add') when you send an object, so you need to either add the command, as such:
{"add": {"doc":{"userName": "Bill", "stars": 4, "review_id": "-TsVN230RCkLYKBeLsuz7A", "type": "review", "business_name": "Eric Goldberg, MD", "user_id": "zvJCcrpm2yOZrxKffwGQLA", "text": "Dr. Goldberg has been my doctor for years and I like him. I've found his office to be fairly efficient. Today I actually got to see the doctor a few minutes early! \n\nHe seems very engaged with his patients and his demeanor is friendly, yet authoritative. \n\nI'm glad to have Dr. Goldberg as my doctor."}}}
Or place it in an array:
[{"userName": "Bill", "stars": 4, "review_id": "-TsVN230RCkLYKBeLsuz7A", "type": "review", "business_name": "Eric Goldberg, MD", "user_id": "zvJCcrpm2yOZrxKffwGQLA", "text": "Dr. Goldberg has been my doctor for years and I like him. I've found his office to be fairly efficient. Today I actually got to see the doctor a few minutes early! \n\nHe seems very engaged with his patients and his demeanor is friendly, yet authoritative. \n\nI'm glad to have Dr. Goldberg as my doctor."}]
See also: https://wiki.apache.org/solr/UpdateJSON
Related
I would like to add some custom data to emails and to be able to filter them by using GraphAPI.
So far, I was able to create a Schema Extension and it gets returned successfully when I query https://graph.microsoft.com/v1.0/schemaExtensions/ourdomain_EmailCustomFields:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#schemaExtensions/$entity",
"id": "ourdomain_EmailCustomFields",
"description": "Custom data for emails",
"targetTypes": [
"Message"
],
"status": "InDevelopment",
"owner": "hiding",
"properties": [
{
"name": "MailID",
"type": "String"
},
{
"name": "ProcessedAt",
"type": "DateTime"
}
]
}
Then I patched a specific message https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/Messages/hidingmessageid:
PATCH Request
{"ourdomain_EmailCustomFields":{"MailID":"12","ProcessedAt":"2020-05-27T16:21:19.0204032-07:00"}}
The problem is that when I select the message, the added custom data doesn't appear by executing a GET request: https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/Messages?$top=1&$select=id,subject,ourdomain_EmailCustomFields
Also, the following GET request gives me an error.
Request: https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/Messages?$filter=ourdomain_EmailCustomFields/MailID eq '12'
Response:
{
"error": {
"code": "RequestBroker--ParseUri",
"message": "Could not find a property named 'e2_someguid_ourdomain_EmailCustomFields' on type 'Microsoft.OutlookServices.Message'.",
"innerError": {
"request-id": "someguid",
"date": "2020-05-29T01:04:53"
}
}
}
Do you have any ideas on how to resolve the issues?
Thank you!
I took your schema extension and copied and pasted it into my tenant, except with a random app registration I created as owner. then patched an email with your statement, and it does work correctly.
A couple of things here,
I would verify using microsoft graph explorer that everything is correct. eg, log into graph explorer with an admin account https://developer.microsoft.com/en-us/graph/graph-explorer#
first make sure the schema extensions exists
run a get request for
https://graph.microsoft.com/v1.0/schemaExtensions/DOMAIN_EmailCustomFields
It should return the schemaextension you created.
then
Run a get request for the actual message you patched not all messages that you filtered for now.
https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/Messages/MESSAGEID?$select=DOMAIN_EmailCustomFields
here the response should be the email you patched and your EmailCustomField should be in the data somewhere, if it is not, that means that your patch did not work.
then you can run patch again from graph explorer
I did all this from graph explorer, easiest way to confirm.
two other things,
1) maybe the ?$top=1 in your get first message isn't the same message that you patched?
2) as per the documentation, you cannot use $filter for schema extensions with the message entity. (https://learn.microsoft.com/en-us/graph/known-issues#filtering-on-schema-extension-properties-not-supported-on-all-entity-types) So that second Get will never work.
Hopefully this helps you troubleshoot.
I have problem with MSSQL Server installed on linux, core logs growing up quickly and i see some crash logs, db works fine - i can make queries but sometimes application cannot open connection. How to fix that? Its related with my distro? I use "Linux Mint 18.3"
crash.json:
{
"reason": "0x00000004",
"processName": "sqlservr",
"pid": "17895",
"instanceId": "2ae9114e-8eca-453e-a5c2-bbeb6251cd6c",
"crashId": "24fbd029-e331-4707-9aaf-f847858c98b3",
"threadState": "0x00007f0e2d2916e8",
"threadId": "17899",
"libosThreadId": "0x4",
"buildStamp": "61b979cc9f8723080867e1f890ff5650b3b0dae804f3da8ece065f41216bd0bb",
"message": "RETAIL ASSERT: Expression=(NT_SUCCESS(status)) File=drtl.cpp Line=5326",
"stackTrace": [
"file://package4/windows/system32/sqlpal.dll+0x000000000033D157",
"file://package4/windows/system32/sqlpal.dll+0x000000000033C8AB",
"file://package4/windows/system32/sqlpal.dll+0x0000000000206DBA",
"file://package4/windows/system32/sqlpal.dll+0x000000000033C19F",
"file://package4/windows/system32/sqlpal.dll+0x000000000033844A",
"file://package4/windows/system32/sqlpal.dll+0x000000000037D4E1"
],
"last_errno": "2",
"last_errno_text": "Nie ma takiego pliku ani katalogu",
"distribution": "Linux Mint 18.3",
"processors": "4",
"total_memory": "16723791872",
"timestamp": "Thu Apr 9 09:50:38 2020"
}
also i don't see any suggestions in error.log
When I try searching for products that are having "camel" in their display names. All the indexing procedure have been done. The problem here is:
When I search "camel" I get: 1 product
"name": "CHANEL HYDRA BEAUTY CAMELLIA WATER CREAM ILLUMINATING HYDRATING FLUID 30ML"
But When I search "CAMELL": I get 3 products from solr:
{
"name": "CLE DE PEAU Lipstick #5 Camellia"
},
{
"name": "CHANEL HYDRA BEAUTY CAMELLIA WATER CREAM ILLUMINATING HYDRATING FLUID 30ML"
},
{
"name": "HERA Rouge Holic Shine No.315 Camellia Orange"
}
When I search CAMEL. I must have got these 3 as well. Why isn't it working?
The issue was fixed after setting the wildcard flag as true to the indexed properties, in Hybris. Thanks to everyone for your help and ideas.
I am working on a mini-simple app using NoSQL. I currently have the design below and I am seeking practical advice and feedback on the database schema design.
Here is the basic overview of the website: A user can log in (via Google or Github), create a course review, other users can rate this course, give comments and also favorite this course.
Here is the schema design for now:
/user
"userid": "12jdfbvsidf3123"
"username": "admin"
"FirstName": "Jobs"
"LastName": "Tim"
"email": "123123#123.edu"
"rated"
"course1": 2
"course2" 3
"favorites":
"course1_id": 2
"course2_id" 3
/courses
"courseid": "sfgsdfwthrw34523"
"userid": "12jdfbvsidf3123"
"title": "the Art of Copy and Paste from StackOverflow"
"instructor": "you-know-nothing"
"rating": 0
"introduction": "bla bla bla"
"timestamp": "2017-08-09"
/comments
"commentid": "242334h5kjh2j4"
"userid": "12jdfbvsidf3123"
"courseid": "sfgsdfwthrw34523"
"content": "Great course, tell me all about how to copy and paste without thinking"
"timestamp": "2019-09-07"
I'm working with a JSON file that was sent to me. I keep getting a parse error on line 7 (begins with "overview) of this JSON file. The error reads: Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
I ran the JSON through JSONLint and got the same message. What's going on here? You can see the file below (I've only included the beginning here, since it's long. I tried removing the entry that causes the error to see if it was a random thing, but the "overview" name causes the same error on the next entry as well). Any thoughts would be very helpful!
{
"page": 1,
"results": [{
"poster_path": "\/il9XWx5CbNd2KdDUwrcClEZiLkv.jpg",
"adult": false,
"overview": "Last months of World War II in April 1945. As the Allies make their final push in the European Theater,
a battle - hardened U.S.Army sergeant in the 2 nd Armored Division named Wardaddy commands a Sherman tank called Fury and its five - man crew on a deadly mission behind enemy lines.Outnumbered and outgunned,
Wardaddy and his men face overwhelming odds in their heroic attempts to strike at the heart of Nazi Germany.
",
"release_date": "2014-10-15",
"genre_ids": [10752,
18,
28
],
"id": 228150,
"original_title": "Fury",
"original_language": "en",
"title": "Fury",
"backdrop_path": "\/pKawqrtCBMmxarft7o1LbEynys7.jpg",
"popularity": 11.717304,
"vote_count": 2435,
"video": false,
"vote_average": 7.43
// more entries with the same name/value pairs... same error for next entry
// when I get to the "overview" name.
}],
"total_results": 70,
"total_pages": 4
}
don't use comments
don't break the lines (String Values) - "overview" property;
{
"page": 1,
"results": [{
"poster_path": "\/il9XWx5CbNd2KdDUwrcClEZiLkv.jpg",
"adult": false,
"overview": "Last months of World War II in April 1945. As the Allies make their final push in the European Theater, a battle - hardened U.S.Army sergeant in the 2 nd Armored Division named Wardaddy commands a Sherman tank called Fury and its five - man crew on a deadly mission behind enemy lines.Outnumbered and outgunned, Wardaddy and his men face overwhelming odds in their heroic attempts to strike at the heart of Nazi Germany.",
"release_date": "2014-10-15",
"genre_ids": [10752,
18,
28
],
"id": 228150,
"original_title": "Fury",
"original_language": "en",
"title": "Fury",
"backdrop_path": "\/pKawqrtCBMmxarft7o1LbEynys7.jpg",
"popularity": 11.717304,
"vote_count": 2435,
"video": false,
"vote_average": 7.43
}],
"total_results": 70,
"total_pages": 4
}