[yocto] [layerindex-web][PATCH 2/2] views.py: Consider layer name in recipe search

Jose Lamego jose.a.lamego at linux.intel.com
Tue Jan 24 10:47:43 PST 2017


ping

On 01/18/2017 04:31 PM, Jose Lamego wrote:
> From: Alex Franco <alejandro.franco at linux.intel.com>
> 
> Recipe search cannot be narrowed to a specific layer, producing
> unnecessary results.
> 
> This change allows including a layers name when searching for recipes to
> narrow the yielded results by adding a layer name to the simplesearch.getquery
> call in the recipe search view.
> 
> [YOCTO #6618]
> 
> Signed-off-by: Jose Lamego <jose.a.lamego at linux.intel.com>
> ---
>  layerindex/views.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/layerindex/views.py b/layerindex/views.py
> index 03fadbb..5db6fbc 100644
> --- a/layerindex/views.py
> +++ b/layerindex/views.py
> @@ -406,7 +406,8 @@ class RecipeSearchView(ListView):
>              qs0 = init_qs.filter(pn=query_string).order_by(*order_by)
>              qs0 = recipes_preferred_count(qs0)
>  
> -            entry_query = simplesearch.get_query(query_string, ['pn'])
> +            entry_query = simplesearch.get_query(
> +                query_string, ['pn', 'layerbranch__layer__name'])
>              qs1 = init_qs.filter(entry_query).order_by(*order_by)
>              qs1 = recipes_preferred_count(qs1)
>  
> 

-- 
Jose Lamego | OTC Embedded Platforms & Tools | GDC



More information about the yocto mailing list