Up until recently, there was some kind of auto-wrapping of merged content and content in the results returned from Azure Cognitive Search, meaning that results returned fitted inside the window and were reasonably easy to read.
It now goes off in one single straight line for the length of the preview and has to be scrolled sideways to see the text.
Does anyone have any tips for how to encode this wrapping function into the JSON definition for the index?
Created azure search index and indexed few documents.
I have performed search in azure search explorer and search results are as returned as shown below
Format of Request URL: https://[service name].[search.windows.net/indexes](http://search.windows.net/indexes "http://search.windows.net/indexes")/[index name]/docs?[query parameters]
Request Type: Get
Request Headers: Content-Type: application/json
Api-key: [admin or query key]
As highlighted in above screenshot, For the document 21583473018.pdf.docx, content and merged_content are in a single line and need to scrolled to sideways to view all the content.
You can use postman to call the search service and the search results are auto-wrapping in Json format.
Using postman, I have called the search service Api and getting results as shown below:
Refer this link to call search service through postman.
Related
I am trying to find a specific source of data programmatically on a page:
https://finance.yahoo.com/quote/3DP.AX/financials?p=3DP.AX
When I "view page source" on the page, I only find once instance of:
,"3DP.AX":
after which the data I require occurs. So in my code, I have:
UrlFetchApp.fetch("https://finance.yahoo.com/quote/3DP.AX/financials?p=3DP.AX").getContentText().indexOf(",\"3DP.AX\":")
^^ this however returns -1
I managed to find the data I need in the response of UrlFetchApp and discovered it occurs after:
{"quoteData":{"3DP.AX":
However, I cannot find this string in view page source. I cleared my cache and this didn't change the page source results.
Question: Is it possible for the data on "view page source" to be different from the data returned by UrlFetchApp?
It is possible for there to be a difference between what UrlFetchApp.fetch receives and what a browser request receives. However, you don't have enough information to reach that conclusion based on your current code.
To access the results of a Fetch request, you need to call getContentText() on the result, currently you are calling indexOf on an HTTPResponse object, not the text body of the response.
Additionally, you should pass a proper string literal to indexOf() - indexOf(',"3DP.AX":')
We want to rewrite a large web project. To make the work more safe we want to cover it by numerous API tests that will be extracted from peeking at the real web calls. (And let us be honest, from the code analysis, too).
Thus I am trying to extract the Json strings sent by different requests. The problem is that the tool provided by the browser (it is practically the same for both FF and Chrome) gives me the Json in a structured form. And I need to use it as strings.
To rewrite all large and deeply structured strings from more than a hundred of requests manually is a horror. How can I copypaste the string representation of request parameters?
I have found that in Chrome - near the "request payload" header there is a switch: view source <-> view parsed. The first variant shows the Json string. BTW, IE has buttons for that and FF... has nothing?
In Firefox: Right click > Copy > Copy POST Data.
You can also "Copy All As HAR" to get the raw body (of every request and response in the list), and "Edit and Resend" will show you the raw body in the UI.
I have a page html let's call it abc.html
There are AngularJS fields embedded in it.
I am now writing a GET and POST in scala which routes the fuzzy search arguments to the proper page on the server.
I am trying to understand the sequence in which things occur in order to implement a GET/POST requests (written in scala) which would happen when someone makes a search on the search bar on the abc.html page, and which would return elements from the database
Is it abc.html (search) --> http GET request --> backend ( AngularJS) --> Database?
In this case this would mean my http post or get request would pass in the html data model elements which would in turn hit the backend AngularJS controller page which in turn would hit the database, and the return ride would send the database results via an http request to the page?
Do I need to explicitly define my GET in terms of angular fields and the database model?
thanks
HTTP uses request-response pairs. This means you don't have to make another request to return anything to the client, you just need to write the proper response. Other than that, your idea is fundamentally right. The process would look something like this:
Type something into the search form on your HTML page
Submit the search form to your backend. This creates a GET or POST request depending on your form element's method attribute.
(At this point the browser is awaiting a response)
As the request reaches the server, your backend code can capture its data and make a query to your database.
(At this point the server is awaiting data from the database)
The database returns its results, your backend code is free to format it into a response to the client's original request.
The client receives the response and you can use your frontend code to display it to the user.
I am looking at the details of a POST request to an Inmagic TextWorks system in Chrome developer tools. If I drill down into the POST, I see this:
Form Dataview sourceview URL encoded
status:
mode:sort
currentPage:1
querySql:[PROCESSED]c:5f:2:61:58:-62:7:3 [bunch of stuff like this]
What am I looking at in querySql? My first thought was that it was Hex, but it contains negative numbers--and when I run it thru a hex to asci converter I get nonsense. My second thought was that it was URL encoding -- but it does not contain and percentages. Clearly this is some kind of encoded SQL -- but how is SQL like this encoded? What is it? How can I tell what it means?
According to InMagic support,
When a user clicks on the 'submit query' button in a search form the
browser gathers up the information in the search boxes and sends it to
the server where WebPublisher can take the information submitted from
a form and conduct a search. This information is grouped in name /
value pairs and then encoded for transmission over the network.
If you continue to read you will see:
This "Canned" query is constructed using the GET method to submit
information to the CGI script. A standard Query to WebPublisher uses
the POST method.
I believe what you see is part of this "Canned" query or a key/value matching.
According to : http://code.google.com/apis/ajaxsearch/documentation/#fonje
I get back a cursor result, but stupidly, the moreResultsUrl returns a URL NOT to the JSON service but to the main site - how do instead fetch the next page of results into JSON?
Well, that's because moreResultsUrl is pointing to http://www.google.com/search instead of http://ajax.googleapis.com/ajax/services/search/web.
What you need are just the parameters of the moreResultUrl which you can pass to http://ajax.googleapis.com/ajax/services/search/web for the JSON result.
For example:
http://www.google.com/search?v=1.0&q=Luca
is translated in JSON with
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Luca
Google is just showing you their RESTful api, it's up to you to use the pages JSON value with whatever interface you want.