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.
Related
I actually want To display Full documents Without duplication
When I use distinct i can only display one particular field
How to display all fields without selecting that document which is repeated
Each document in MongoDB contains an _id field which must be unique in the collection. Hence, it is not possible to have two identical documents in a collection. Ergo, iterating a collection with no conditions will return all unique documents (which are all documents in the collection).
I'm searching a curl command to delete documents filtered with few conditions or other ways to delete specific documents. Is there any way to achieve that?
You can't do that in one query like you would do in SQL.
You have to query the documents with a filter (let's say a Mango Selector). Then, you need to update those documents with the field "_deleted": true to delete it.
Photon admin panel since v1.9.30 allows to select results of viewindex function and treats a selection as a list of documents. Having appropriate index you can select its parent docs and then delete them.
db.collection.createIndex()ΒΆ
Creates indexes on collections.
I understand why we need indexes on documents, but why on collections?
Thanks everyone for helping!
We are not creating indexes on documents, we index documents on collections, selecting one or more keys. Like you index columns in tables on relational DB world.
Just to find right document (row) from collection (table).
the index creates a part in the storage where the engine can look for entries. The parsing of these entries is really fast. In my case it gives me a performance benefit of aditionally 1000%.
A Find or Aggregate searches through this storage and can find the wanted data without parsing the whole collection.
When users searches and clicks a result, we store this search keyword in the DB.
What we get is a list of keywords for every item with the number of times item was clicked for that keyword.
In solr schema I have multivalued field "keywords". How can I add that number of clicks for every keyword on every item and than boost so the most clicked items are on/near the top of results for that keyword ?
I use dismax and for the moment the query for "apple" looks someting like this:
q=apple
qf=title^0.4 keywords:"apple"^0.5
bf=hits^0.4 rating^0.3
So as you can see I boost by "keywords" but the problem is that I don't know which item was most clicked for "apple".
I've tried adding boost parameter to every keyword on initial index import. It didn't help and I'm out of ideas.
How are you maintaining the clicked data ?
How about also maintaining the cumulative clicked data as a single field with the document.
You can easily use this field to boost the documents overall using the dismax boost functions.
A large set of mathematical functions can be used # http://wiki.apache.org/solr/FunctionQuery#What_is_a_Function.3F
I have a document library where i have columns called Title and Category(is a lookup field) and User.Also,I have a list where i am just storing categories. I would like to join both document library and list so that i can dispaly all categories and the documents associated with it. once i get everything i would like to perform filtering so that it dispalys only selected user's documents.The displaying of the documents is working fine but not filtering. My questions is CAn we perform join between doc library and list? Plesae help me.
Thanks
The content query web part (CQWP)is probably the easiest way to do this without code. Since you only have one field in your lookup (categories) you don't need to do a join as SharePoint stores the lookup value in the Document Library. You will need to edit your CQWP to add this field, there is a good tutorial on doing this here. It also explains how to filter your CQWP.
Finally you will need to clean up your lookup field as SharePoint will store the value like this: 1;#Category1.
The CQWP uses XSLT to display the results so in your case you probably don't want to show 1;#Category1 you probably only want to show Category1. You can use the following XSLT to accomplish this:
<xsl:value-of select="substring-after(#Name_Of_Your_Lookup,'#')"></xsl:value-of>