Jump to content

Quick Search - to allow searching with just reference number

Martyn Houghton

Recommended Posts

At the moment the current Quick Search (Ctrl + Shift + F) requires you to enter the whole reference number of the case including the prefix, which we appreciate is done in order to ensure this search uses the index on the h_pk_reference field directly on the table rather than the Global Search method to make is as fast as possible.


Given the system in it settings knows all the prefix combinations and the length of the numerical element of the reference format, can the the quick search be enhanced to allow retrieval of requests  by just entering the number without the prefix and leading zero's. This is especially useful when dealing with a phone call and you need to open up the case quickly and the customer most often will just give you the numerical element of the request id.

In our system we use a prefix of combining our identifier 'IDX' and the request type (IN,SR etc), but even for sites who use a common/simpler prefix just being able to enter the number without the prefix and leading zeros makes it more usable.

In our example the search only needs to add the leading zero's and generate the combinations as part of the query, so it still uses index without the need for a table scan.

select * from h_itsm_requests where h_pk_reference in ('IDXIN00001234','IDXSR00001234','IDXPR00001234','IDXKE00001234','IDXCR00001234','IDXRE00001234')

This could always be set to enabled by a system setting for sites who want to retain the current exact matching behaviour.







Link to comment
Share on other sites

@Martyn Houghton one of the challenges when I looked at this before was when you get multiple matches. If you search for '12' it would potentially match all of the following:

  • IDXIN00000012
  • IDXIN00000112
  • IDXIN00001112
  • IDXIN00011112
  • IDXIN00111112
  • IDXIN01111112
  • IDXIN11111112

Now, clearly, ordering by the reference to get the best match would be best, but if you're looking for an SR, this combination of references would cause an issue:

  • IDXIN00000012
  • IDXSR00000112

Maybe extreme examples, as the numbers are likely to be very specific, but just putting it out there that this could be a real issue that people encounter.

Having said all of that, I will make a note of this and look at what we can do to enhance it to make it easier to use :)

Link to comment
Share on other sites


The intention was that you have to enter the whole numerical reference number but with out the leading zeros or prefix, so in you example of using 12, we would only expect to search for 00000012, i.e. the five request type prefixes.

If the additional matching is required then the analyst would use the Global Search.



Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...