Solved

Search for a number rather than text?

Posted on 2003-12-09
18
261 Views
Last Modified: 2013-12-18
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.
0
Comment
Question by:scribla
  • 7
  • 4
  • 4
  • +1
18 Comments
 
LVL 13

Expert Comment

by:CRAK
ID: 9903460
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
 
LVL 2

Author Comment

by:scribla
ID: 9903468
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
 
LVL 13

Expert Comment

by:CRAK
ID: 9903567
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
 
LVL 31

Expert Comment

by:qwaletee
ID: 9904282
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
 
LVL 13

Expert Comment

by:CRAK
ID: 9904328
I tried it all qwaletee.... it doesn't find numbers!
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9905070
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
 
LVL 2

Author Comment

by:scribla
ID: 9905166
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
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 300 total points
ID: 9905548
COnvert the text value to number in the column formula

@TextToNumber(TEXTFIELDNAME)
0
 
LVL 13

Assisted Solution

by:CRAK
CRAK earned 200 total points
ID: 9907717
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 31

Expert Comment

by:qwaletee
ID: 9909403
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
 
LVL 31

Expert Comment

by:qwaletee
ID: 9909423
Just tried it on a 6 server using a 5 client, no prob.
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9910611
5.0.10 here..... sux!
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9912765
I am talking about what exactly the problem is...

Crak, same here..
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9912909
??? 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
 
LVL 31

Expert Comment

by:qwaletee
ID: 9916992
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
 
LVL 13

Expert Comment

by:CRAK
ID: 9918842
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
 
LVL 2

Author Comment

by:scribla
ID: 9919045
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
 
LVL 2

Author Comment

by:scribla
ID: 9919255
Duh! ignore my last comment. All sorted, works a treat.  Thank you all for your input and thought on this.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now