# Use elastic search to search products in a software product line

**URL:** <https://discuss.elastic.co/t/use-elastic-search-to-search-products-in-a-software-product-line/36641>\
**Category:** Elasticsearch\
**Created:** [December 8, 2015, 2:18pm UTC](https://discuss.elastic.co/t/use-elastic-search-to-search-products-in-a-software-product-line/36641 "2015-12-08T14:18:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlosdcg](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@carlosdcg](https://discuss.elastic.co/u/carlosdcg)\
**Post date:** [December 8, 2015, 2:18pm UTC](https://discuss.elastic.co/t/use-elastic-search-to-search-products-in-a-software-product-line/36641/1 "2015-12-08T14:18:59Z")

</div>

Hello!

Im working with Software Product Lines modeling, and im researching on use well known software solutions to make simpler the computing of feature models.

Im my case want to see if its possible to model FODA feature diagrams using ElasticSearch `https://en.wikipedia.org/wiki/Feature_model#/media/File:E-shopFM.jpg`

The thing is that this is a NP-hard problem and to compute very large features sets can take a lot of time.

And my goal is to answer questions like:

- Most probable feature
- How many valid products are

I will put an example:

I have this features to make a mobile phone:

mobilephone:Phone,  
screen:Component,  
camera:Component,  
lowrescam:Component,  
hirescam:Component,  
flash:Component

With these relationships:  
(mobilephone)-[:MANDATORY]-\>(screen),  
(mobilephone)-[:OPTIONAL]-\>(camera),  
(camera)-[:CHOOSE1]-\>(lowrescam),  
(camera)-[:CHOOSE1]-\>(hirescam),  
(camera)-[:REQUIRES]-\>(flash)

Computing the model we will get the following products:

mobilephone, screen, camera, lowrescam, flash  
mobilephone, screen, camera, hirescam, flash  
mobilephone, screen

The probability of having a camera in a phone is: 2/3  
The probability of having a screen in a phone is: 3/3

So the questions are:

- Is it possible to model this kind of behaviour in ElasticSearch?
- is it possible to create a module to do this? (I will do it)

Im new to ElasticSearch so this is a research question to see if I should dig more on ES.

Thanks.

Carlos.

---

<div class="post-metadata">

**Author:** ![carlosdcg](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@carlosdcg](https://discuss.elastic.co/u/carlosdcg)\
**Post date:** [December 9, 2015, 10:10am UTC](https://discuss.elastic.co/t/use-elastic-search-to-search-products-in-a-software-product-line/36641/2 "2015-12-09T10:10:58Z")

</div>

Any idea or recommendation?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:32pm UTC](https://discuss.elastic.co/t/use-elastic-search-to-search-products-in-a-software-product-line/36641/3 "2017-07-05T23:32:21Z")

</div>


