Menu DEVPPL Search
158.124
MEMBERS
15.939
TOPICS
63.222
POSTS
  562
FLASH GAMES
7.717
TUTORIALS
 

Login

E-mail:
Password:

how to fix the bug

0

Loading

how to fix the bug

Postby Krishnapython » Tue Oct 31, 2006 3:19 am

<!--$#-*- mode: python; indent-tabs-mode: nil; encoding: iso-8859-1 -*-
# Copyright 2000-2003 Verity, Inc. All rights reserved.

threadstate("meidasquery")
if config.agreed != version.version: raise redirect("util/agree.html")
if config.setup:
if not config.passwords: raise redirect("admin/newusr.html")
if config.license_parse(config.license_key)[6]:
raise redirect("admin/editkey.html")
if not config.collections: raise redirect("admin/newcol.html")
else:
if version.expires and version.expires <= self.now:
raise redirect("util/expired.html")
if not config.license_ndocs: raise redirect("util/badkey.html")

# All local variables are assigned from the values in the query
# string in settings.html.
exec self.file('meidassettings.html')

if config.hit_level_auth:
self.parse_authorization()
auth_link = config.query_join(
'get_auth.html','return=meidasquery.html',
self.format_params_query(query,query.keys()))

if rl:
if self.username is None:
raise redirect(auth_link)

self.expire_interval = collectn.query_cache_age
self.text_dict = config.text_dict(la)
self.tip_list = config.tip_list(la)

pushthreadstate("composing")
cols = []
if col:
for c in string.split(col):
if config.collections.has_key(c):
cols.append(config.collections[c])
else:
for c in config.collections.values():
if c.default_search: cols.append(c)

qcols = []
if qc:
for c in string.split(qc):
if config.collections.has_key(c):
#if c.name=="meidas12":
qcols.append(config.collections[c])
else:
for c in config.collections.values():
if c.default_show: qcols.append(c)
#if c.name=="meidas12":
qcols.sort(lambda x,y:cmp(x.name,y.name))

# Put terms from advanced interface into a single query string
i = 0
aq = []
last_op = None
while 1:
opname = "op"+str(i)
flname = "fl"+str(i)
tyname = "ty"+str(i)
txname = "tx"+str(i)
i = i+1
if not query.has_key(opname): break
if not query.has_key(flname): break
if not query.has_key(tyname): break
if not query.has_key(txname): break
op = query[opname][0] # '+', '-', or ''
fl = query[flname][0] # 'fieldname:' or ''
ty = query[tyname][0]
# Strip out any " the user put in.
#tx = querytools.normalize(string.join(string.split(string.join(query[txname]),'"')))
tx = querytools.normalize(string.join(string.split(string.join(query[txname]),'*')))
if not tx: continue
if op == '' and qi!=0 and not last_op:
last_op = " <ANY> "
aq.append( last_op )
if ty=="w": # "the words"
if aq: aq.append(",")
for wrd in string.split(tx):
if aq: aq.append(" ")
aq.append(op)
aq.append(fl)
aq.append(wrd)
del wrd
elif ty=="p": # "the phrase"
if aq: aq.append(", ")
aq.append(op)
aq.append(fl)
aq.append('"')
aq.append(tx)
aq.append('"')
elif ty=="n": # "the name"
if aq: aq.append(", ")
aq.append(op)
aq.append(fl)
aq.append('"')
aq.append(string.capwords(tx))
aq.append('"')
del op,fl,ty,tx
aq = string.join(aq,"")
del i
del opname, flname, tyname, txname

fsqt = ''
if fs:
# "Find Similar" - get defining terms for the document and
# add to the query.
fsqt = querytools.make_find_similar_qt(cols,fs)


# Get query terms from simple or advanced interface.
qtaq = []
if qt: qtaq.append(qt)
if aq: qtaq.append(aq)
qtaq = string.join(qtaq,", ")

# Add Thesaurus expansions
any_operator = ""
if ex and qi!=0 and not qtaq.lstrip().startswith("<ANY>"):
any_operator ="<ANY> "
if qtaq and ex: qtex = any_operator + qtaq+u', '+ex
elif qtaq and not ex: qtex = qtaq
elif ex: qtex = any_operator + ex
else: qtex = qtaq

# If doing a drill-down query, add prior query terms
if ex and qi!=0 and not oq.lstrip().startswith("<ANY>"):
any_operator ="<ANY> "
if not oq: oqqtex = qtex
elif qtaq and ex: oqqtex = any_operator + oq+u', '+ex+u' | '+qtaq
elif qtaq: oqqtex = oq+u' | '+qtaq
elif ex: oqqtex = any_operator + oq+u', '+ex
else: oqqtex = oq
del any_operator

# Combine fs and query terms
if fsqt and oqqtex: qti = fsqt+u' || '+oqqtex
elif fsqt and not oqqtex: qti = fsqt+u' ||'
else: qti = oqqtex

# if appropriate, lowercase the query
if settings["lowercase_query"]: qtil = querytools.normalize(qti,1)
else: qtil = qti


# Do not use format_params with query_nodef because we may
# need all these values for Internet Search.
if not preview:
wwwhref = 'http://software-search.ultraseek.com/wwwsearch.html'\
+'?qt='+urlquote(qtil)+'&la='+la+'&nh='+str(nh)+'&lk='+str(lk)+'&charset='+(self.charset or config.charset)
else:
wwwhref = preview_path
if rq==2: raise redirect(wwwhref)

filename = posixpath.split(path)[1]
if not filename:
filename = 'meidasindex.html'


topicbrowse_prfx = config.query_join(filename,'qm=1',
self.format_params_query(query_nodef,
format_all_but(["ct","qm","qt","ex","fs"])))

topicsearch_prfx = config.query_join(filename,'qm=1',
self.format_params_query(query_nodef,
format_all_but(["ct","qm","fs"])))
# Note: topic id 0 is a valid value for ct
this_topic = None
tq = ""
if ct is not None:
this_topic = topic.current.id.get(ct)
if not this_topic: ct = None
elif this_topic.__class__ == topic.XrefTopic:
raise redirect(config.query_join(topicbrowse_prfx,'ct='+str(this_topic.xref)))
else: tq = this_topic.search_prefix()

# Add any Topic restriction to query string
if tq: qtti = tq+u' || '+qtil
else: qtti = qtil

# Add any Query Prefix restriction
if qp: qpqt = qp+u' || '+qtti
else: qpqt = qtti

# Add any Query Suffix restriction
if qs: qpqtqs = qpqt+u', '+qs
else: qpqtqs = qpqt

popthreadstate("composing")

reload = string.lower(self.hdrs.get('pragma',''))=="no-cache"

# don't do spellcheck and passages for topics browse or find similar
enable_passages = settings["enable_passages"]
enable_spell = settings["enable_spell"]
if fs or (ct is not None and not qti):
enable_spell = 0
enable_passages = 0

pushthreadstate("search")
hits,ndocs,terms,titles,site_dict = collectn.cached_query7(
cols,
qpqtqs,
nh=nh,
st=st,
rf=rf,
reload=reload,
now=self.now,
before=before,
after=after,
lang=la,
ws=ws,
sc=sc,
user=self.username,
password=self.password,
query_interp=qi)
popthreadstate("search")

if hits > 0: content_target = 1

# If automatic spell-correction redirect failed, return to the original text.
if oldqt and oldqt != qt and hits == 0:
new_query = config.query_join(
filename, 'qt=' + urlquote(oldqt), 'oldqt=' + urlquote(oldqt),
self.format_params_query(query_nodef,format_all_but(['qt','oldqt'])))
raise redirect(new_query)

hltsuffix = ''
for term, doccount in terms:
if highlight.highlightable_term(term, la):
hltsuffix += "fterm=%s&" % urlquote(term)
if hltsuffix:
hltsuffix += "la=" + la + "&charset=" + self.charset
if config.collect_clickthrough:
hltsuffix += "&qt=" + urlquote(qpqtqs) + "&col=" + urlquote(col)
# Preserve all parameters, highlight directs back to this exact page
backhref = config.query_join(filename,
self.format_params_query(query_nodef, format_all_but([])))
#else: no highlightable terms; don't make highlight link

# Set the title for the search result page
if fs and not oqqtex: title = self.text(u'Documents similar to')+' '+fs
elif ct is None or oqqtex: title = self.text(u'Results for')+" '"+oqqtex+"'"
elif this_topic is None: title = self.text(u'Topic')+': '+str(ct)
else: title = self.text(u'Topic')+': '+this_topic.name


#Vijay : Identify Source (in/out of Meidas) of request
#source = query.get("qf")
#if source != '' and source != 'None' : exec self.file("header.html")
#else: exec self.file("/header.html")
exec self.file("header.html")

# Set CSS classes for kind of results page
if ct is not None and not qti: --><div class=browse><!--$
elif ct is not None: --><div class=topicsearch><!--$
else: --><div class=search><!--$
-->
<div class=resultspage>
<!--$
pushthreadstate("top form")
# HREFs used in top line of query form
query_string = self.format_params_query(query_nodef,
format_all_but(['qm']))
href0 = config.query_join(filename,'qm=0',query_string)
href1 = config.query_join(filename,'qm=1',query_string)
href2 = config.query_join(filename,'qm=2',query_string)
# Switching between Simple and Advanced query forms
hrefa = config.query_join(filename,
'ql='+(((not ql) and 'a') or ''),
'qt='+urlquote(qtaq),
self.format_params_query(query_nodef,
format_all_but(['ql','qt','oldqt'])))

# Query form
if (((ct is None or qti) and settings['query_form_above']) or
((ct is not None and not qti) and settings['browse_form_above'])):
formname = "seek1"
if qm!=1 or terms and hits:

exec self.file("meidasqueryform"+str(qm)+ql+".html")
elif ct is None and not oq and not fsqt:
exec self.file("meidasqueryform0"+ql+".html")
else:
tmp = oqqtex
oqqtex = oq
exec self.file("meidasqueryform1"+ql+".html")
oqqtex = tmp
popthreadstate("top form")

# Top Ad
top_ad = 0
if ads.ad_top(): exec self.file("ad_top.html")

# Quicklinks
if st == 1: exec self.file("quicklinks.html")

# Spelling suggestion
if enable_spell and st == 1:
exec self.file("spell.html");
-->
<!--per Jackie request, the result is to be commented out-->
<!--<div class=resultstop>-->

<div class=subtopics>
<!--$
if ct is not None and st==1 and settings['subtopics_above'] and not qti:
exec self.file("subtopics.html")
-->
</div>
<!--$
if hits: exec self.file("meidashits.html")
elif ct is None or qti: exec self.file("nohits.html")
else: --><p><b>&$self.text(u'No documents in topic.');</b><p><!--$

# Bottom Ad
if ads.ad_bottom_repeat(): exec self.file("ad_bottom_repeat.html")
if ads.ad_bottom(): exec self.file("ad_bottom.html")
# Bottom Query Form
if (((ct is None or qti) and settings['query_form_below']) or
((ct is not None and not qti) and settings['browse_form_below'])):
pushthreadstate("bottom form")
formname = "seek2"
if qm!=1 or terms and hits:
exec self.file("queryform"+str(qm)+ql+".html")
elif ct is None and not oq and not fsqt:
exec self.file("queryform0"+ql+".html")
else:
tmp = oqqtex
oqqtex = oq
exec self.file("queryform1"+ql+".html")
oqqtex = tmp
popthreadstate("bottom form")
-->
<div class=subtopics>
<!--$
if ct is not None and st==1 and settings['subtopics_below'] and not qti:
exec self.file("subtopics.html")
-->
</div>
</div> <!--$# class=resultspage -->
</div> <!--$# class=browse, topicsearch, or search -->
<!--$
#Vijay : Identify Source (in/out of Meidas) of request
#if query.get("qf",[""]) != "mds" : exec self.file("/footer.html")


# Start sending the page before query logging
self.flush(1)

pushthreadstate("logging")
# No more data can be added to the page
collectn.count_query(self.now)

if st==1:
# log the collections actually searched, not the ones requested
searched_cols = map(lambda c: c.name, cols)
searched_cols.sort()
config.query_log_write(
time.strftime('%Y/%m/%d %H:%M:%S ',time.localtime(self.now))
+u'\t'+unicode(hits)
+u'\t'+string.join(searched_cols,',')
+u'\t'+qpqtqs
+u'\n')
else:
# user viewed the next page. page view!
pagenum = (int(st)-1)/int(nh)+1
config.click_log_write(
time.strftime('%Y/%m/%d %H:%M:%S ',time.localtime(self.now))
+'\t'+'view'
+'\t'+col
+'\t'+qpqtqs
+'\t'+str(pagenum)
+'\n')
popthreadstate("logging")
-->
here is the code to fix the bug.
this is html page scipted in python.
actual scenarioa is there is home page topnavigation.xsl with one dropdown textbox having the two options 1.meidas search and agilent search.
when we search with option 1 it takes to the html page which i have given the code .

here when we search with some text it is searching correctly within the meidas but when i research same it is goiing beyond the application and searching in agilent.

there is col=meidas it is hitting when we research it.
so,can any one fix the bug so that when it research it should hit col=meidas.col is collections.
Krishnapython
 
Reputation: 0
Posts: 2
Joined: Mon Oct 30, 2006 11:18 am
Highscores: 0
Arcade winning challenges: 0

how to fix the bug - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Postby Krishnapython » Wed Nov 01, 2006 3:58 am

hi no idea
Krishnapython
 
Reputation: 0
Posts: 2
Joined: Mon Oct 30, 2006 11:18 am
Highscores: 0
Arcade winning challenges: 0
^ Back to Top