I have requirement to "bookmark" certain Solr query result containing a document. The query is known and the document id is known as well. The result set would obviously change with time but I was wondering if it is possible to execute a query on the Solr and Solr would return result set with proper offset so that desired document would be present in the paged result set if present.
I would compare it to the requirement to bookmark Google search results on the page where result contains www.stackoverflow.com/question/1
Is this possible?
Related
I'm using Azure Search to query a data set relating to documents. I'm querying the data to fetch the documents that are owned by a particular user based on their email address.
The data set within the index contains a column called UploadedBy which represents the user who uploaded the document.
My query looks like this.
search=myuseremail#mycompany.com&searchFields=UploadedByEmail
The search query speficies the value to look for and the column in which to search for it. However, I'm getting results returned that do not match this search criteria i.e. where the email address contains a different email address.
How do I prevent these from being returned? Am I missing something from my seach?
probably you're getting results that match:
myuseremail#abcde.com
and
*#mycompany.com
this is not wrong, it's the expected behavior since an email has '.' and it's considered a stop word. If you want the exact match, you should use search="myuseremail#mycompany.com", escape your '.' or replace them to another char that is not a stop word.
As another option, use a custom analyzer to avoid breaking on "." for emails.
I have application which has solr search facility. When i query for search result comes only fields which has the values. How to get the result with empty field values in solr? How to get all the fields in result even though the value of a field is empty?
Only the fields present is stored with each document, so if you want to keep empty fields actually available, you'll have to explicitly index empty content into the field. How you do that depends on how you're indexing documents to Solr today.
You can work around this by fetching the schema for the core / collection you're querying first, retrieve the field names and adding empty fields for each field present in the schema, if necessary.
It'll probably be easier to assume that missing fields are empty, and wrap your code in a check to see if the field is present, and if not, return an empty value instead.
The reason for this is that while Solr uses a schema, the underlying Lucene library does not - any document can contain a set of field names unrelated to the other documents present in the index. Since the schema can change independent of the content of the index as well (a schema change will not update existing documents), returning non-existing fields isn't straight forward - and for most cases the document returned should be as close to possible to what was actually indexed.
We have implemented Site search for our project. Nutch is used for crawling the content of the site.
Currently, we have all the records being crawled and indexed in SOLR and the search functionality works for any keyword search.
Issue we are facing is the search result relevancy, we are not able to perform boost on fields and show the result.
For example, we are indexing the fields title, description, keywords, URL and content.
When I search for any keyword “XYZ”, all the records with this keyword are displayed based on the term frequency.
However, when I give boost to the field title in query filter-
a. Title^5 – search results are displayed which has the keyword in title, but it is not picking the records with “XYZ” in content.
b. Title^5 content^1.1 – in this scenario, search results are not displayed based on the title relevancy, and the default term frequency behavior is noted.
Does anyone know how I can retrieve the NUMBER OF ITEMS in a category in netsuite?
I'm hoping for a getAttribute tag of some sort. I need the count of total items in order to create a pagination string url.
The simple method is to create a saved search with the criteria/filters you need.
You can create saved search either programmatically or by using the tools available in netsuite.
The length of the result of saved search will show the total NUMBER OF ITEMS.
NOTE : If you want, you can retrieve the entire details of each product from saved search results.
i need to develop a search application , where many documents are indexed with different fields and a id field which is unique for each of the document . Fields are not stored just indexed except for id field
i need to find out for each document , the documents similar to this, here all i have is unique id field of current document , i dont have any other fields of current document to form Terms and query the index for finding similar documents like current one.
How do i do this ? any help greatly appreciated .
I believe the simplest way to do this is to use Solr, and use Solr's MoreLikeThisHandler.
You can use a query likehttp://localhost:8983/solr/select?q=unique_id:2722&mlt=true&mlt.fl=manu,cat&mlt.mindf=1&mlt.mintf=1&fl=id,score
Do you have any control over how these documents are indexed? You can index with term vectors, and at query time, look up the term vector for the document, construct a query using the terms, and submit the query.