Search for a number rather than text?

I have a small database containing fixed assets. Each asset has a number E.G. 123. When the database was written the number was stored in a text field rather than a number field. I recently changed this to a number field as it was number '1000' was showing at the the bottom of the view, with '999' at the top.

So I changed the field in the form to a number field, then edited and saved each doc to update. The problem is I can no longer use the content of this field/view to search for say asset number '503' it just comes back with no results.

I deleted and created a new text index, but no change. Will I have to revert to storing this asset number as text in order for the search to work? If so, how would I create a view that sorts 999 as a lower value than 1000?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You could convert the old text values to numbers using an agent:

Field assetnumber := @TextToNumber(@Text(assetnumber));

I first convert ALL values to text, then to number to avoid errors on your new (number) documents:
@TextToNumber(<number>) will raise an error like "text expected".
scriblaAuthor Commented:
CRAK, I don't have any old text values, I have taken care of the conversion, the asset numbers in the field in question are stored as numbers.
Sorry, now I see what you mean.
Yes... that's unfortunately how the searchbar works.

You could either reconvert the numbers to text,
Add an additional field (computed) to store the same number as text
Use the options under "more" to look specifically for documents where field (assetnumber) is equal to 503.

I never realized that it didn't find numbers!
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Did you delete and recreate the ful text index AFTER converting all numbers to text?

Did you make sure all remnants of the ld full text index were removed before recreating the index?

Did you try compacting the database between the destruction and recreation of the full text index?
I tried it all qwaletee.... it doesn't find numbers!
R5 full text index supposedly index text only ! Not sure why they removed support for numbers which was available in R4. Not sure of R6 though ? Kind of limitation. Let me see if I can find any more information.

scriblaAuthor Commented:
I'm guessing finding numbers in the FTI is out of the question.
So, if I convert back to text, what's the best practice to store as text, but be able to sort 'as' numbers in my view?

What I mean by that is a number field in a view would sort 1000,999,998,997,etc. but a text field in a view would result in 3,2,1,1000.

COnvert the text value to number in the column formula


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Or try the option of a 2nd, computed field:
You'll always find the right doc's in the searchbar, and youll always be able to use the seach by field (under "more") to look for numbers over or under a certain value. You can't do that with text!

Show the numeric field to users, compute the text. Use either one in columns etc.
> R5 full text index supposedly index text only ! Not sure why they removed
> support for numbers which was available in R4. Not sure of R6 though ? Kind
> of limitation. Let me see if I can find any more information.

What are you talking about?  I just tried it, no problem.  Of course, the client I just tried it with was an early version of 5, and I do know they tweaked the engine a bit during the 5 release cycle (I think 5.0.5).
Just tried it on a 6 server using a 5 client, no prob.
5.0.10 here..... sux!
I am talking about what exactly the problem is...

Crak, same here..
??? Same there, but you don't know what the problem is?
Create a number field. Create a new doc, fill out the number field with a known value, create/update the FT index, search for the number and find out what the question is about and why 5.0.10 sux.
Have you tried searching by field name for the new field?

And why would anyone use .10 anyway.  .12 has been out for six months already.
Sure I have.... that works ok. But like I said, I never knew RT search didn't pick up numbers if only entered in the searchbar. And honestly, thats the only dissapointment that I can think of.
Use of 5.0.10 is determined by the company. It's probably too much effort to roll out updates. Administratoes have tried updates, especially for admin client (remote console) related bugs. Temporarily up to .13 I believe.
I'd rather see 6.x installed so I'd finally get to play with those features!
scriblaAuthor Commented:
Running 5.0.10 client and server here, we should roll out R6 early next year.

I have converted my numbers back to text again, search works as expected, but I still have a problem with my view. I tried @TextToNumber(AssetNo) against my view coloumn, but with strange results. My view coloumn is now populated with values like 1E+02, 10E+02. However, it is at least sorting correctly now!
scriblaAuthor Commented:
Duh! ignore my last comment. All sorted, works a treat.  Thank you all for your input and thought on this.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.