You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@manifoldcf.apache.org by Karl Wright <da...@gmail.com> on 2014/07/09 16:04:25 UTC

Re: Query in Sharepoint connector

Hi Ameya,

Here's the code for indexing a list item:

>>>>>>
                    RepositoryDocument data = new RepositoryDocument();
                    data.setBinary( is, 0L );

                    if (modifiedDate != null)
                      data.setModifiedDate(modifiedDate);
                    if (createdDate != null)
                      data.setCreatedDate(createdDate);

                    setDataACLs(data,acls,denyAcls);

                    setPathAttribute(data,sDesc,documentIdentifier);

                    if (metadataValues != null)
                    {
                      Iterator<String> iter =
metadataValues.keySet().iterator();
                      while (iter.hasNext())
                      {
                        String fieldName = iter.next();
                        String fieldData = metadataValues.get(fieldName);
                        data.addField(fieldName,fieldData);
                      }
                    }
                    data.addField("GUID",guid);
<<<<<<

Note the GUID field.  It is not optional in any way.

Here's the code for indexing a document:

>>>>>>
                RepositoryDocument data = new RepositoryDocument();
                data.setBinary( is, documentLength );

                data.setFileName(mapToFileName(documentIdentifier));

                if (contentType != null)
                  data.setMimeType(contentType);

                setDataACLs(data,acls,denyAcls);

                setPathAttribute(data,sDesc,documentIdentifier);

                if (modifiedDate != null)
                  data.setModifiedDate(modifiedDate);
                if (createdDate != null)
                  data.setCreatedDate(createdDate);

                if (metadataValues != null)
                {
                  Iterator<String> iter =
metadataValues.keySet().iterator();
                  while (iter.hasNext())
                  {
                    String fieldName = iter.next();
                    String fieldData = metadataValues.get(fieldName);
                    data.addField(fieldName,fieldData);
                  }
                }
                data.addField("GUID",guid);
<<<<<<

Note that GUID is also set and is non-optional.

Karl



On Wed, Jul 9, 2014 at 9:57 AM, Ameya Aware <am...@gmail.com> wrote:

> Also, i can not see 'GUID' in Solr both for Lists and documents. (I have
> changed Solr schema to add GUID there.).
>
>
> Thanks,
> Ameya
>
>
> On Wed, Jul 9, 2014 at 9:51 AM, Ameya Aware <am...@gmail.com> wrote:
>
>> Hi Karl,
>>
>> I am seeing Shared documents from Sharepoint.
>>
>> Thanks,
>> Ameya
>>
>>
>> On Tue, Jul 8, 2014 at 5:52 PM, Karl Wright <da...@gmail.com> wrote:
>>
>>> Hi Ameya,
>>>
>>> There is no difference in treatment between created date and modified
>>> date that I can find in the connector.  Can you tell me what kind of
>>> SharePoint entity you are seeing this on?  Eg documents, list items,
>>> attachments?
>>>
>>>
>>> Karl
>>>
>>> Sent from my Windows Phone
>>> ------------------------------
>>> From: Ameya Aware
>>> Sent: 7/8/2014 3:41 PM
>>> To: Karl Wright
>>> Subject: Re: Query in Sharepoint connector
>>>
>>>  I did not get you properly. Please see below if it satisfies your query.
>>>
>>> Last modified is date field in Sharepoint. When i run job and send
>>> metadata to Solr, the date which is being sent to Solr is far different
>>> than that of it is in Sharepoint.
>>>
>>> Please let me know if you need any more details.
>>>
>>> Thanks,
>>> Ameya
>>>
>>>
>>>
>>> On Tue, Jul 8, 2014 at 3:35 PM, Karl Wright <da...@gmail.com> wrote:
>>>
>>>> What does this field look like in SharePoint?
>>>>
>>>> Karl
>>>>
>>>> Sent from my Windows Phone
>>>> From: Ameya Aware
>>>> Sent: 7/8/2014 1:50 PM
>>>> To: dev@manifoldcf.apache.org
>>>> Subject: Query in Sharepoint connector
>>>> Hi
>>>>
>>>> Last_modified metadata sent from Sharepoint to Solr is not giving
>>>> correct
>>>> values.
>>>>
>>>> Even last_modified showing lesser value than created_by date.
>>>> (Created_by
>>>> date is coming good).
>>>>
>>>> Is this bug?
>>>>
>>>> Thanks,
>>>> Ameya
>>>>
>>>
>>>
>>
>

Re: Query in Sharepoint connector

Posted by Karl Wright <da...@gmail.com>.
Hi Ameya,

The only other possibility is that the metadata is being filtered out by
your configuration of the solr connection.  You can determine this by
looking at the [INFO] log statements from Solr to see if GUID is in the URL
being posted.

Karl


On Wed, Jul 9, 2014 at 10:11 AM, Ameya Aware <am...@gmail.com> wrote:

> Yeah.. i noticed that but still GUID is not coming in Solr.
> Solr schema file is modified already to add GUID field to that.
>
> What could be the issue here?
>
>
> Thanks,
> Ameya
>
>
> On Wed, Jul 9, 2014 at 10:04 AM, Karl Wright <da...@gmail.com> wrote:
>
>> Hi Ameya,
>>
>> Here's the code for indexing a list item:
>>
>> >>>>>>
>>                     RepositoryDocument data = new RepositoryDocument();
>>                     data.setBinary( is, 0L );
>>
>>                     if (modifiedDate != null)
>>                       data.setModifiedDate(modifiedDate);
>>                     if (createdDate != null)
>>                       data.setCreatedDate(createdDate);
>>
>>                     setDataACLs(data,acls,denyAcls);
>>
>>                     setPathAttribute(data,sDesc,documentIdentifier);
>>
>>                     if (metadataValues != null)
>>                     {
>>                       Iterator<String> iter =
>> metadataValues.keySet().iterator();
>>                       while (iter.hasNext())
>>                       {
>>                         String fieldName = iter.next();
>>                         String fieldData = metadataValues.get(fieldName);
>>                         data.addField(fieldName,fieldData);
>>                       }
>>                     }
>>                     data.addField("GUID",guid);
>> <<<<<<
>>
>> Note the GUID field.  It is not optional in any way.
>>
>> Here's the code for indexing a document:
>>
>> >>>>>>
>>                 RepositoryDocument data = new RepositoryDocument();
>>                 data.setBinary( is, documentLength );
>>
>>                 data.setFileName(mapToFileName(documentIdentifier));
>>
>>                 if (contentType != null)
>>                   data.setMimeType(contentType);
>>
>>                 setDataACLs(data,acls,denyAcls);
>>
>>                 setPathAttribute(data,sDesc,documentIdentifier);
>>
>>                 if (modifiedDate != null)
>>                   data.setModifiedDate(modifiedDate);
>>                 if (createdDate != null)
>>                   data.setCreatedDate(createdDate);
>>
>>                 if (metadataValues != null)
>>                 {
>>                   Iterator<String> iter =
>> metadataValues.keySet().iterator();
>>                   while (iter.hasNext())
>>                   {
>>                     String fieldName = iter.next();
>>                     String fieldData = metadataValues.get(fieldName);
>>                     data.addField(fieldName,fieldData);
>>                   }
>>                 }
>>                 data.addField("GUID",guid);
>> <<<<<<
>>
>> Note that GUID is also set and is non-optional.
>>
>> Karl
>>
>>
>>
>> On Wed, Jul 9, 2014 at 9:57 AM, Ameya Aware <am...@gmail.com>
>> wrote:
>>
>>> Also, i can not see 'GUID' in Solr both for Lists and documents. (I have
>>> changed Solr schema to add GUID there.).
>>>
>>>
>>> Thanks,
>>> Ameya
>>>
>>>
>>> On Wed, Jul 9, 2014 at 9:51 AM, Ameya Aware <am...@gmail.com>
>>> wrote:
>>>
>>>> Hi Karl,
>>>>
>>>> I am seeing Shared documents from Sharepoint.
>>>>
>>>> Thanks,
>>>> Ameya
>>>>
>>>>
>>>> On Tue, Jul 8, 2014 at 5:52 PM, Karl Wright <da...@gmail.com> wrote:
>>>>
>>>>> Hi Ameya,
>>>>>
>>>>> There is no difference in treatment between created date and modified
>>>>> date that I can find in the connector.  Can you tell me what kind of
>>>>> SharePoint entity you are seeing this on?  Eg documents, list items,
>>>>> attachments?
>>>>>
>>>>>
>>>>> Karl
>>>>>
>>>>> Sent from my Windows Phone
>>>>> ------------------------------
>>>>> From: Ameya Aware
>>>>> Sent: 7/8/2014 3:41 PM
>>>>> To: Karl Wright
>>>>> Subject: Re: Query in Sharepoint connector
>>>>>
>>>>>  I did not get you properly. Please see below if it satisfies your
>>>>> query.
>>>>>
>>>>> Last modified is date field in Sharepoint. When i run job and send
>>>>> metadata to Solr, the date which is being sent to Solr is far different
>>>>> than that of it is in Sharepoint.
>>>>>
>>>>> Please let me know if you need any more details.
>>>>>
>>>>> Thanks,
>>>>> Ameya
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Jul 8, 2014 at 3:35 PM, Karl Wright <da...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> What does this field look like in SharePoint?
>>>>>>
>>>>>> Karl
>>>>>>
>>>>>> Sent from my Windows Phone
>>>>>> From: Ameya Aware
>>>>>> Sent: 7/8/2014 1:50 PM
>>>>>> To: dev@manifoldcf.apache.org
>>>>>> Subject: Query in Sharepoint connector
>>>>>> Hi
>>>>>>
>>>>>> Last_modified metadata sent from Sharepoint to Solr is not giving
>>>>>> correct
>>>>>> values.
>>>>>>
>>>>>> Even last_modified showing lesser value than created_by date.
>>>>>> (Created_by
>>>>>> date is coming good).
>>>>>>
>>>>>> Is this bug?
>>>>>>
>>>>>> Thanks,
>>>>>> Ameya
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>