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?

Thanks.
LVL 2
scriblaAsked:
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.

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

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

note:
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".
0
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.
0
CRAKCommented:
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!
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

qwaleteeCommented:
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?
0
CRAKCommented:
I tried it all qwaletee.... it doesn't find numbers!
0
HemanthaKumarCommented:
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.


~Hemanth
0
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.

0
HemanthaKumarCommented:
COnvert the text value to number in the column formula

@TextToNumber(TEXTFIELDNAME)
0

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
CRAKCommented:
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.
0
qwaleteeCommented:
HemanthaKumar,
> 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).
0
qwaleteeCommented:
Just tried it on a 6 server using a 5 client, no prob.
0
CRAKCommented:
5.0.10 here..... sux!
0
HemanthaKumarCommented:
I am talking about what exactly the problem is...

Crak, same here..
0
CRAKCommented:
??? 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.
;-))
0
qwaleteeCommented:
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.
0
CRAKCommented:
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!
0
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!
0
scriblaAuthor Commented:
Duh! ignore my last comment. All sorted, works a treat.  Thank you all for your input and thought on this.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.