Nested CAML Query for 6 parameters - nested

I have one search page.
page have 6 textboxes as a search criteria which user should fill.
According to those 6 textboxes I want to make search on Document library.
The sql query for same will be like this =>
SELECT * FROM SOMETABLE WHERE NAME="xyz" or CLIENT="abc" or ADDRESS="lmn" or ROLE="wxy" or STATUS="nop" or AUTHOR="efg";
Please tell me how to write CAML Query for this.
Please share if you have any link to understand nested caml query.

I asked a similar question with more parameters. The question with an answer is here: CAML query with nested AND's and OR's for multiple fields

Related

How can I delete documents from couchdb using filters?

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.

sum function in camlx query - sharepoint

i have two list in sharepoint like:
LIST1:ID,Title,Visitor,Website
LIST2:ID,Title,MaxVisitor
i want to write this in camlex or caml query but i don't know how
select from sum(LIST1.Visitor)>List2.MaxVisitor groupby LIST1.Website
You can use SPSiteDataQuery for querying multiple list ,

Sharepoint Aggregate lists

I'm trying to aggregate results from different list types. Using Join feature in Sharepoint designer won't cut it. What I want to achieve is eq. to in T-SQL "Select x AS y".
For example - The column "Title" doesn't exist in one list type but the column "Name" does.
What I want to do is as I would in SQL: "Select Name as Title"
I've tried looking into CAML but no luck there.
Much appreciated
V
You could achieve this using the Camelot .NET Connector for SharePoint, available at http://www.bendsoft.com/net-sharepoint-connector/
When using it you may question your SharePoint lists and document libraries as if they where ordinary SQL tables.
Ie.
SELECT LinkTitle as Title, CreatedDate as `Created Date`, ID as `List item id` FROM WhatEverListYouLike WHERE ID > 10
There are also predefined functions to handle most common operations of documents like FileUpload and FileDownload. These are covered in the documentation - http://docs.bendsoft.com/camelot-net-connector/latest/procedures/

how do i get all the similar documents without any search terms

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.

Performing join between document library and list

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>

Resources