ravil baizhiyenov

Greenhorn
+ Follow
since Oct 22, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by ravil baizhiyenov

I was looking for information about how to solve the same problem and came across this topic... Just to help others out with a similar issue, I'd encourage them to see the following article: http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html?page=1. I found it quite helpful...
14 years ago
ok... well basically I had a wrong id for the last link, that's a pretty silly mistake...

And also, it wasn't working because I was adding an empty space by using
Thanks a lot for your reply, Eric. It helped me a lot. However, can you please tell me why I can't append a space using my method?
Just use the following for the style:

position:absolute;
left:0px;
top:0px;

Hope it helps
Hi Eric, thanks for your reply!

I think I just reused a piece of existing code, so that's why the "document.getElementById".
I will change it though. I think i didn't really catch that, was a little tired =).

I have had href equal nothing on a lot of my "a" elements... Can you please explain why should I have it equal to "#" instead?

Thanks for the suggestion on the whitespace, I will change it. Although I don't think that these changes will make it work...
Will reply when I test the code tomorrow morning.

Thanks again!
Hi everyone,

This problem is really frustrating because I understand that it is quite simple stuff, but I can't find the solution!
I know that to add a onclick property I need to use code like the following:

However, I can't make it worj in the following chunk of code:


I will be using this code to create links to different pages for the search results. Off course, instead of alert(); I will insert a call to a proper function.
So the problem is that only the "Last" link works..

If I comment the "Last" link section out the onclick works for the first one...

I don't really know what is up with it...

Would appreciate your help! Please point where I have an absolutely stupid mistake...
ok.. I guess I asked a question that I am able to answer myself again.

Embarrassing =))

In CASE statements, I just need to check for each word separately... The more matches the record has, the higher its score is. Therefore we will be able to order by the number of matches i.e. relevance...

There we go. Hope someone finds this information useful.
Hello everyone,

I am trying to order my search results by their relevance... Basically, I have an advanced search form with multiple input fields. Then I query a db table against the matching criteria. (Using Full Text in MS SQL 2005 Express).

In order to sort results by their relevance, I used ORDER BY CASE. Here is a sample query:



Here, as you can see, I select rows that satisfy FREETEXT([description], 'report sudbury').
Then, in ORDER BY clause I first check if the record contains a full search phrase (report sudbury). After I check if it contains both words from the phrase. Then either word, and finally if it contains FREETEXT of the search phrase. In each case I award a satisfying record one point. So, as you see the more relevant records contain more points, so we can now order them by relevance.

Its all okay if the number of words in a search phrase is small (report sudbury in this case)...

The problem is that you have to consider more than n! cases (where n is the number of words in the search phrase) to order records by relevance.
For example: if we have 3 words in the phrase, we need to check the following:
- if the record contains a full phrase
- if the record contains any 2 words from the phrase (could be words 1 AND 2, or 1 AND 3, or 2 AND 3)
- if the record contains one word from the phrase (choices: 1 or 2 or 3)

So this method ends up being not very feasible...

Therefore, my question is: is there a more optimal way to sort records by their relevance?

Thanks!
Thank for you reply!

Yes, the problem was related to the FT service... Apparently after a certain timeout SQL server has to reload the service. And that takes too long... More on this here: http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/699221f0-a850-4f1d-b1db-a067a172f866/

workaround:
sp_fulltext_service 'verify_signature', 0;
GO

Seems to be working fine for now...
For some reason, FULL TEXT search on my database takes too long to complete the first time. I mean the first time I perform it, it takes about 30 seconds to search the table (which is really small - only some 13 records). However, it then works fine for some time...

I tried using Management Studio, and get same performance issues.

Here is the sql statement I use:

SELECT * FROM Report WHERE FREETEXT([description], 'report')



Please help!
lol

Happen to close my own topic again =)

Anyways, I guess, just for the reference of whoever will be looking for a similar solution, I will post what I found...

The two most convenient ways to pass data is either through session, or forwarding request (using RequestDispatcher). I used the second method. Quick example can be found here: http://onjava.com/pub/a/onjava/excerpt/java_cookbook_ch18/index.html?page=8.
In my case I pass ArrayList to jsp and then iterate through it using jstl...

If you have any comments, you're welcome to post them here.

Now... If someone gave me a hint how to implement paging.... =)
14 years ago

seetharaman venkatasamy wrote:ya. it is fine to me with one changes in your order . dbConn.java - connects to the db MODEL[DAO] should come after the validate.java - checks user input MODEL[related to the controller][carefully see the steps in your diagram ]



Thanks for your response!

I actually do verify user input before querying the database. If it isn't valid, I go straight to step 6 (i.e. send error msg to jsp).

The only thing that I don't really know yet, is what is the most efficient way to send the response to jsp... Should I use a RequestDispatcher (which is sort of confusing to me), or something else?

On my other jsp page I access DAO object directly through jstl to populate a drop down. However, in this case I don't think that I can do so, because it complicates things..
14 years ago
Good morning (... day, evening) ranchers.

I have yet another MVC question. I can't always wrap my mind around it, because I'm fairly new to the concept...
Anyways. Please take a look at the following image and let me know if you have any suggestions as of how to better implement the solution:



It should provide searching capabilities for a SQL database.
search.jsp - displays the form, sends it to the servlet and should display the results. VIEW
search.do - servlet that receives data and prepares the response by accessing a few java classes CONTROLLER
dbConn.java - connects to the db MODEL
validate.java - checks user input MODEL
searchDTO.java - data class (to store individual results), will be a member of ArrayList MODEL

Please let me know if I got the concept right....

Also, please suggest a way to send the results to jsp... (On jsp, I guess, I will use jstl to render the results.)

Thank you very much, any help would be appreciated!
14 years ago
Ok... well i figured it out..
The problem was that i had

for a the form elements. I guess i have to learn css a little better =)
Haven't had too much practice with it yet, still trying to learn.
Now if someone could give me a hint why it was the case..... thanks!