How to create a custom field in SOLR response? - search

I am trying to compare two fields (say lastnames), the result should be populated on the go with other fields when I query. So can I have an option to create such custom field in solr which compares the fields and give the results when queried ?

This seems a use case for Function Values[1] .
Just explore the available function queries[2], select the one which is the best fit for you and use it as the value of a pseudo field.
[1] https://lucene.apache.org/solr/guide/6_6/common-query-parameters.html#CommonQueryParameters-FunctionValues
[2] https://lucene.apache.org/solr/guide/6_6/function-queries.html#FunctionQueries-AvailableFunctions

Related

How can I use Dynamic feature to find an item by value

I have a table that has many random generated items in it. I need to choose one. Loading the table in a collection, then looping into it is so much work and time. Is there a way to use Dynamic feature in blueprism to achieve the same work faster and in less steps?
A combination of wildcard for the ID and dynamic features for value or matching index will do the trick. In action, add a navigate stage, choose the item and pass in the value or number for matching index in param.

Azure search - how to implement multiple facet search?

For example, if we have category facet and it returns withe 5 different categories, on clicking of the first category, the other categories will not be available in the response. I want to implement multiple facet search.
Appreciate your response.
For more info, i am referring the same scenario as below:
https://feedback.azure.com/forums/263029-azure-search/suggestions/7762452-provide-multiselect-facets
The facet in the response is limited to the selected and this feature is not supported. I'd suggest to vote for it here https://feedback.azure.com/forums/263029-azure-search/suggestions/7762452-provide-multiselect-facets
A workaround is to send multiple queries to get facets and filtered results separately.
For example,
1. keep all facets in the UI (or make another query to get all facets) after the first search query; 2. make another search query after another facet is selected provided that the application tracks what facets the user has selected.
if you want to filter results with multiple facets , you can modify your filter as below :
$filter = search.in(country, 'USA,Canada,Mexico,Brasil,Chile,Argentina', ',')
The first parameter to the search.in function is the string field reference (or a range variable over a string collection field in the case where search.in is used inside an any or all expression). The second parameter is a string containing the list of values, separated by spaces and/or commas. If you need to use separators other than spaces and commas because your values include those characters, you can specify an optional third parameter to search.in.
This third parameter is a string where each character of the string, or subset of this string is treated as a separator when parsing the list of values in the second parameter.
For more information about OData expression syntax for filters and order-by clauses in Azure Search, please refer to this tutorial.
I've recently run into this limitation and my workaround was to run a separate query for each facet as suggested by #rudin above.
Let's say for example that your application has facets for Colour, Brand and Size. Your primary search query includes all three filters but doesn't return any facets. You then run an additional query ignoring any selected Colours, which will give you all available colour values for the chosen brands and sizes, and you do the same for the brand and size facets.
For the additional queries it's important to set the 'Size' property to 0 so no search results are returned - just the relevant facet.
By doing this and running these queries asynchronously the performance overhead is minimal in my case with 6 facets.

SharePoint unique values from lookup

I have a list with a lookup column that is getting "Created" dates from another list, but I only want the unique date values. Is there a way to get this data or to create a calculated column with unique values?
A lookup field actually links to a single item, the display value is more a "human readable" value for the link to the items ID value.
You may also get some mileage from a normal text or even date field and using jQuery and SPServices on the edit and new forms in order to provide changes to the form for the user. This avoids doing a code level customisation for the site that a Custom Field would require.
Not out of the box I dont think. My best bet is to create a Custom Field type that extends lookup with the functionality you are after.

How to retrieve search results from two fields in lucene index, giving one query?

Suppose I search for a query in Field A, and I want to retrive the corresponding fields B and C from my index, how should I go about it? I am using Lucene 3.6.0.
The results of your query will be returned as a set of documents, not fields. Once you've got a document, you can load whichever field contents you're interested in.
One thing that's probably worth watching out for is to ensure that your fields have been "stored".
Good luck,

View Filtering in Xpages

I've been trying to filter the view by second sorted column but so far it doesn't work.
(my underlying view is sorted by first column categorized and sorted by ascending, and the second column is sorted by ascending order as well)
How can i get through this thing? and I don't want to create one more view for this filtering
To filter by multiple keys you need to use a Java Vector with the keys you want to filter by. Here's an example of applying a filter to a sessionScope variable that you then use for the keys property of the view:
var vArray = new java.util.Vector();
vArray.addElement("key1");
vArray.addElement("key2");
sessionScope.put('viewFilter', vArray);
For search function, We have two different ways are there. One is normal search just like OS level.And another is Full index search.
Please follow the below link, U will get better idea,
[Search Query][1]
[1]: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPagesViewControlAddFullTextSearch.htm

Resources