# Run mediamapper manually

**URL:** <https://forum.litium.com/t/run-mediamapper-manually/146>\
**Category:** Questions\
**Tags:** litium-6, accelerator\
**Created:** [July 4, 2018, 12:36pm UTC](https://forum.litium.com/t/run-mediamapper-manually/146 "2018-07-04T12:36:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ericsj11](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ericsj11/32/899_2.png) [@Ericsj11](https://forum.litium.com/u/Ericsj11)\
**Post date:** [July 4, 2018, 12:36pm UTC](https://forum.litium.com/t/run-mediamapper-manually/146/1 "2018-07-04T12:36:45Z")

</div>

We are using the mediamapper in a project and it works as expected when we have a product and then we drag in a new image.

But if the image is all ready uploaded to the media folder, is it possible to map that image to a product that is being created?

Litium version: 6

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [July 4, 2018, 1:44pm UTC](https://forum.litium.com/t/run-mediamapper-manually/146/2 "2018-07-04T13:44:45Z")

</div>

No, not possible!  
For that you will need to create an EventListener that fires each time a new product is created and looks inside the media folders to find matching product ID and bind them together.

---

<div class="post-metadata">

**Author:** ![emilsjog](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@emilsjog](https://forum.litium.com/u/emilsjog)\
**Post date:** [January 30, 2019, 12:30pm UTC](https://forum.litium.com/t/run-mediamapper-manually/146/3 "2019-01-30T12:30:10Z")

</div>

Is this still the way to go? Seems unnecessary to implement a behavior that is already in place with the media mapper. Is there no event that can be triggered to make the media mapper go through the folder again?

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [January 30, 2019, 12:54pm UTC](https://forum.litium.com/t/run-mediamapper-manually/146/4 "2019-01-30T12:54:36Z")

</div>

Not that I am aware of for the moment, you need to implement that.

---

<div class="post-metadata">

**Author:** ![emilsjog](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@emilsjog](https://forum.litium.com/u/emilsjog)\
**Post date:** [February 13, 2019, 8:18am UTC](https://forum.litium.com/t/run-mediamapper-manually/146/5 "2019-02-13T08:18:12Z")

</div>

Trying to implement something that triggers the media mapper. But I need to make a search on the files and want to make a search like the one in the BO, but from code. Any directions on what to use for the search? Should I use the `DataService.CreateQuery` or something else?

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [February 13, 2019, 8:33am UTC](https://forum.litium.com/t/run-mediamapper-manually/146/6 "2019-02-13T08:33:46Z")

</div>

Yes you can use that, some hints also here:  
[https://docs.litium.com/documentation/previous-versions/litium-6/litium-documentation/media/import-media-files](https://docs.litium.com/documentation/previous-versions/litium-6/litium-documentation/media/import-media-files)

---

<div class="post-metadata">

**Author:** ![emilsjog](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@emilsjog](https://forum.litium.com/u/emilsjog)\
**Post date:** [February 13, 2019, 10:26am UTC](https://forum.litium.com/t/run-mediamapper-manually/146/7 "2019-02-13T10:26:10Z")

</div>

How do I search with contains using the dataservice? Started with this but it requires the name to be equal to the value i’m passing in. But I want it to return all that contains the value i’m passing in.

```
    using (var query = _dataService.CreateQuery<File>())
    {
        var items = query.Filter(x => x
            .Bool(b => b
                .Should(m => m.Field(SystemFieldDefinitionConstants.NameInvariantCulture, "eq", "123"))
                ));
    }
```

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [February 13, 2019, 10:56am UTC](https://forum.litium.com/t/run-mediamapper-manually/146/8 "2019-02-13T10:56:18Z")

</div>

Try “contains” instead of “eq”.

---

<div class="post-metadata">

**Author:** ![emilsjog](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@emilsjog](https://forum.litium.com/u/emilsjog)\
**Post date:** [February 13, 2019, 12:35pm UTC](https://forum.litium.com/t/run-mediamapper-manually/146/9 "2019-02-13T12:35:01Z")

</div>

Nice, thank you.
