Bug 1431882 - Search backend cannot find VMs which name starts with a search keyword
Summary: Search backend cannot find VMs which name starts with a search keyword
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Infra
Version: 4.0.6.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: bugs@ovirt.org
QA Contact: Lukas Svaty
URL:
Whiteboard:
: 1513580 1581570 (view as bug list)
Depends On:
Blocks: 1797717
TreeView+ depends on / blocked
 
Reported: 2017-03-14 00:00 UTC by Logan Kuhn
Modified: 2020-02-11 15:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1797717 (view as bug list)
Environment:
Last Closed: 2020-02-11 15:41:17 UTC
oVirt Team: Infra
Embargoed:
mperina: ovirt-future?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)

Description Logan Kuhn 2017-03-14 00:00:52 UTC
Description of problem:
If I do a search in the web console or via the API it doesn't find the VM.  Despite the fact that I have a VM named idempiere-dev.  If I search for dev it finds it and any other Vm with dev in the name.

Version-Release number of selected component (if applicable):
4.0.6.3

How reproducible:
100%

Steps to Reproduce:
1. Create a VM named idempiere
2. Search for idempiere

Actual results:
Does not find idempiere 

Expected results:
Finds idempiere

Additional info:
We are using a 4.0.6.3 Hosted Engine environment and haven't tested any other version because we don't have one to test.  

The log file shows: 2017-03-13 11:27:33,268 INFO  [org.ovirt.engine.core.bll.SearchQuery] (default task-19) [] ResourceManager::searchBusinessObjects - erroneous search text - ''Vms: idempiere''

Comment 1 Martin Perina 2017-03-14 07:44:34 UTC
Is this specific to the term 'idempiere' or also to other prefixes? For example if you have VM named 'myvm-dev' are you able to search for it using "Vms: myvm"?

Also could you please attach server.log and engine.log from your setup?

Comment 2 Martin Perina 2017-03-14 07:57:16 UTC
OK, found the issue, we show an error while searching for VMs which name starts with 'id' prefix

Comment 3 Yedidyah Bar David 2017-03-14 09:15:14 UTC
(In reply to Martin Perina from comment #2)
> OK, found the issue, we show an error while searching for VMs which name
> starts with 'id' prefix

And also any other keyword. Tried with 'ip'.

Comment 4 Martin Perina 2017-03-24 09:08:47 UTC
Moving to 4.2 until we investigate how complex this it to fix

Comment 5 Martin Perina 2017-03-30 10:49:13 UTC
So after investigation fixing this issue would require too complex changes in search backend code, so moving to ovirt-future for now. 

But there's a fully functional workaround for this feature:

 Vms:name=idempiere

The above will work as expected without any side effects.

Comment 9 Logan Kuhn 2017-11-03 18:25:39 UTC
Vms:name=idempiere no longer works in 4.1.6.  It returns the same as VMsidempiere, no results found.

Comment 10 Martin Perina 2017-11-08 11:58:02 UTC
(In reply to Logan Kuhn from comment #9)
> Vms:name=idempiere no longer works in 4.1.6.  It returns the same as
> VMsidempiere, no results found.

I've just tested on 4.1.6.1 that all of the below expressions works as expected:

  Vms: name=idempiere
    - returning only VM with name 'idempiere'

  Vms: name=id*
    - returning all VMs starting with prefix 'id' (case insensitive)

  Vms: idempiere
    - returns empty list because id is a predefined keyword

  Vms: id*
    - returns empty list because id is a predefined keyword

Comment 11 Logan Kuhn 2017-11-08 13:54:36 UTC
Yep, that works fine.... i wonder what changed in our environment in the last week, because i tried all those things and they failed.  Regardless it's working with all the examples you provided where it should work, it also works with the one I reported as failing if I add a star (*) or type the full name.

Comment 12 Martin Perina 2017-11-15 20:17:10 UTC
*** Bug 1513580 has been marked as a duplicate of this bug. ***

Comment 13 Martin Perina 2018-05-26 08:28:10 UTC
*** Bug 1581570 has been marked as a duplicate of this bug. ***

Comment 14 Beni Pelled 2018-05-27 08:22:52 UTC
(In reply to Martin Perina from comment #5)
> So after investigation fixing this issue would require too complex changes
What kind of fix did you think?

IMO, the fix should be that using keyword should be 'keyword=' or 'keyword:' and any other search will not attempt to use a keyword,

Does such fix require too complex changes?

> in search backend code, so moving to ovirt-future for now. 
> 
> But there's a fully functional workaround for this feature:
> 
>  Vms:name=idempiere
> 
> The above will work as expected without any side effects.

Comment 15 Martin Perina 2018-05-30 12:12:30 UTC
(In reply to Beni Pelled from comment #14)
> (In reply to Martin Perina from comment #5)
> > So after investigation fixing this issue would require too complex changes
> What kind of fix did you think?
> 
> IMO, the fix should be that using keyword should be 'keyword=' or 'keyword:'
> and any other search will not attempt to use a keyword,
> 
> Does such fix require too complex changes?

Unfortunately yes, because currently parsing is performed by characters and it determines keywors only from previous and current character without looking at following characters. So fixing that would require to completely rewrite parsing part of SearchEngine which is quite big and dangerous task.

So due to resource limitation moved to future

Comment 17 Martin Perina 2020-02-11 15:41:17 UTC
According to Comment 10 you can search for VM names starting with predefined keyword if you use name identifier:

  Vms: name=idempiere

In the above example id is predefined keyword, list of all keywords is provided in Comment 8.

If we would like to fix the issue with search VM names without name identified:

  Vms: idempiere

then we would need to completely rewrite search engine code and this is very resource consuming operation with great danger of creating additional errors.

Because searching using name identifier is fully supported and works as expected, I'm closing this bug.


Note You need to log in before you can comment on or make changes to this bug.