# Are MediaPointerPdfArray baseproduct fields indexed

**URL:** <https://forum.litium.com/t/are-mediapointerpdfarray-baseproduct-fields-indexed/1138>\
**Category:** Questions\
**Created:** [October 9, 2019, 7:17am UTC](https://forum.litium.com/t/are-mediapointerpdfarray-baseproduct-fields-indexed/1138 "2019-10-09T07:17:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hans](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/hans/32/31_2.png) [@hans](https://forum.litium.com/u/hans)\
**Post date:** [October 9, 2019, 7:17am UTC](https://forum.litium.com/t/are-mediapointerpdfarray-baseproduct-fields-indexed/1138/1 "2019-10-09T07:17:25Z")

</div>

Are baseproduct fields of type MediaPointerPdfArray indexed in Lucene? We have a set of media files and want to find all products that have pointers to any of the files. Searching with filter tags does not yield any result and trying to investigate by using a read tag it seems like there aren’t any values indexed.

Litium version: _5.6.0_

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [October 9, 2019, 7:49am UTC](https://forum.litium.com/t/are-mediapointerpdfarray-baseproduct-fields-indexed/1138/2 "2019-10-09T07:49:25Z")

</div>

Have you implemented any `Litium.Studio.FieldFramework.IIndexFieldDocumentTagsConverter` for the custom field?

Example

```auto
using System;
using System.Collections.Generic;
using System.IO;
using Litium.FieldFramework;
using Litium.Foundation.Modules.MediaArchive;
using Litium.Foundation.Search.Constants;
using Litium.Framework.Search.Indexing;
using Litium.Media;
using Litium.Runtime.DependencyInjection;

namespace Litium.Studio.FieldFramework.FieldFrameworkConverters
{
    [Service(Name = SystemFieldTypeConstants.MediaPointerFile)]
    internal class IndexDocumentTagMediaPointerFileField : IIndexFieldDocumentTagsConverter
    {
        private FileService _fileService;
        public IndexDocumentTagMediaPointerFileField(FileService fileService)
        {
            _fileService = fileService;
        }
        public ICollection<DocumentTag> ConvertToIndexDocumentTags(IndexFieldTypeConverterArgs arg, object item)
        {
            var result = new List<DocumentTag>();
            if (item == null)
            {
                return result;
            }

            var tagName = TagNames.GetTagNameForProperty(arg.FieldDefinition.Id);

            var value = (Guid)item;
            if (value != Guid.Empty)
            {
                if (ModuleMediaArchive.ExistsInstance)
                {
                    var file = _fileService.Get(value);
                    if (file != null && file.BlobUri != null)
                    {
                        result.Add(new DocumentTag(TagNames.FileId, file.SystemId) { Analyzed = true });
                        result.Add(new DocumentTag(TagNames.Body, file.Name) { Analyzed = true });
                        result.Add(new DocumentTag(TagNames.Body, Path.GetFileNameWithoutExtension(file.Name)) { Analyzed = true });
                    }
                }
            }
            return result;
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![hans](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/hans/32/31_2.png) [@hans](https://forum.litium.com/u/hans)\
**Post date:** [October 9, 2019, 8:22am UTC](https://forum.litium.com/t/are-mediapointerpdfarray-baseproduct-fields-indexed/1138/3 "2019-10-09T08:22:06Z")

</div>

> [@patric.forsgard](#):
>
> Have you implemented any `Litium.Studio.FieldFramework.IIndexFieldDocumentTagsConverter` for the custom field?

No, did not know about that but will try. Is there documentation on this on the docs site?

---

<div class="post-metadata">

**Author:** ![hans](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/hans/32/31_2.png) [@hans](https://forum.litium.com/u/hans)\
**Post date:** [October 9, 2019, 10:11am UTC](https://forum.litium.com/t/are-mediapointerpdfarray-baseproduct-fields-indexed/1138/4 "2019-10-09T10:11:18Z")

</div>

Realized that the _MediaPointerPdfArray_ is a custom type (that implements FieldTypeMetadataBase)…

Anyway, what’s the correct way to index an array of values? Should the _IIndexFieldDocumentTagsConverter.ConvertToIndexDocumentTags()_ method return a collection of tags using the same tag name or should it contain a (serialized?) representation of all values?

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [October 9, 2019, 7:33pm UTC](https://forum.litium.com/t/are-mediapointerpdfarray-baseproduct-fields-indexed/1138/5 "2019-10-09T19:33:03Z")

</div>

The method should return a list of tags that you want added to the search index, see above example.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [November 6, 2019, 7:33pm UTC](https://forum.litium.com/t/are-mediapointerpdfarray-baseproduct-fields-indexed/1138/6 "2019-11-06T19:33:04Z")

</div>

Closed on November 6, 2019, 7:33pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
